software-mansion / software-mansion/TypeGPU

test: Whenever we test if schemas encode and decode binary correctly, let's automatically test if both the compiled and non-compiled writers work correctly.

Open
#2,658 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.2k
Forks
122
Avg merge
3d 5h
Merged PRs (30d)
34

Description

We could do this via some sort of expect().toEncodeTo() and expect().toDecodeTo() helpers, or via just helpers that run the calculation twice, make sure the output is the same, and return one of them.

expectEncoded(schema, 123).toMatchInlineSnapshot(...) // writes twice, compares, and returns one of the results

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the tests that verify binary schema encoding and decoding, then identify how compiled and non-compiled writers are currently exercised. Define the helper approach with the existing test conventions, and consider the work done when those tests automatically run both writers, compare their outputs, and preserve the existing snapshot coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.