Skip to content

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. #2658

Description

@iwoplaza

Our writers have two paths:

  • (if supported) dynamically generated functions that are specialized per schema to write into a buffer
  • (fallback) interpreting schemas and dynamically writing to a buffer

The implementation is chosen based on whether compiledIO.ts#EVAL_ALLOWED_IN_ENV is true or not.

Possible solution

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

Activity

  1. pullfrog commented on Jun 29, 2026

    @pullfrog
    Contributor
  2. added
    stabilityTasks that focus on improving stability, that includes tests, refining edge-cases, refactoring.
    on Oct 19, 2026
  3. added theissue type on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

stabilityTasks that focus on improving stability, that includes tests, refining edge-cases, refactoring.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions