Add a node:test suite - #67
Merged
Merged
Conversation
typeof null is "object", so a null options slipped past the guard and threw
on options.from. Route it to the default {} like undefined already is.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Cover language resolution, request building, response parsing, and error handling deterministically through the public options.dispatcher seam, plus one live smoke test that checks a real response still parses into our shape. Add the test and test:coverage npm scripts to run it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Split lint out of npm test into a separate npm run lint step, and collapse the publish workflow to a single lint-gated job. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
iamtraction
force-pushed
the
test/node-test-suite
branch
from
August 5, 2026 15:22
4d7b5c7 to
821419c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the library's first automated test suite, built on Node's built-in
node:testrunner — no test framework, no new dependencies.getCoderesolution: codes, names, script-subtag casing, and unknownsdtserialization, and the GET→POST switch, asserted against the request captured off a mocked dispatcherMocked tests run through the public
options.dispatcheroption, so nothing internal is stubbed. Lint moves to its ownnpm run lintstep, separate fromnpm test.Also fixes a latent bug:
translate(text, null)threw becausetypeof null === "object"slipped past the options guard; it now defaults like a missing argument.🤖 Generated with Claude Code