ReviewOS

home-lang/home

Port jsonwebtoken ESM test utility module

#280
Closed chris opened this 11 days ago ·
11 days ago

Bun corpus slice

  • Position 4030: js/third_party/jsonwebtoken/set_headers.test.js (already green, 2/2)
  • Position 4031: js/third_party/jsonwebtoken/test-utils.js

Gap

The helper is discovered by the corpus scanner as a test-shaped JavaScript file, but it is an ESM utility module with named and default exports rather than a standalone test. Home currently rewrites its import but leaves the export declarations for the script evaluator, producing SyntaxError: Unexpected keyword 'export'.

Acceptance criteria

  • evaluate the real helper implementation and register its named/default utility surface for jsonwebtoken tests
  • treat successful standalone helper evaluation as an intentional empty fixture, not an unsupported file
  • retain synchronous/asynchronous JWT result and structured-error parity
  • add the helper to the permanent JWT/utility mini-suite
  • focused positions 4030–4031 pass with zero failures or unsupported files
11 days ago

Implemented and pushed in c1922c6 (feat(third-party): port JWT test utilities).

What landed:

  • Bun's real test-utils.js helper now evaluates after ESM-to-bootstrap rewriting
  • named helpers and the default helper object are registered together under ./test-utils
  • the upstream helper's synchronous/asynchronous token and structured-error comparison behavior is preserved
  • its standalone execution is explicitly recognized as an intentional helper fixture with no registered tests
  • the file is now part of the permanent third-party JWT/utility mini-suite

Verification:

  • position 4031: 0 failed, 0 unsupported, 1 intentional allowed-empty fixture
  • sequential positions 4030–4032: 4 passed, 0 failed/todo/unsupported, 1 allowed-empty fixture
  • always-on JWT/utility mini-suite: passed
  • gRPC stack diagnostics and SQL adapter contracts: passed

This advances the contiguous full-corpus boundary through position 4032: 374 files, 3,389 passed, 225 todo, 0 failed, 0 unsupported (172 allowlisted empty files).

Sign in to comment on this issue.