W-23516608: Add unit tests for extracted DataWeave Node.js binding modules#131
Merged
Merged
Conversation
Add unit tests for the pure modules extracted in W-23516605, expanding the Group A unit lane (no dwlib required). No src/ changes. - reader.test.ts (14): createChunkReader over sync and async iterables — bufSize boundary slicing, empty input, empty-buffer skipping, Uint8Array chunks, copy semantics, async pre-buffering, and input-error-as-EOF. - stream.test.ts (6): streamFromNative bridge — chunk ordering, the park-then-wake backpressure path, drain-after-done, and success/failure/ empty terminal metadata propagation (native call injected, no addon). - errors.test.ts (5): DataWeaveError / DataWeaveScriptError — name, instanceof chain, message fallback, and attached result. Unit tests: 35 -> 60 passing. Unit-lane coverage over src/** rises from ~39% to ~72% (errors 100%, reader 100%, stream ~95%). dataweave.ts/index.ts remain integration-lane surface (Group B). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
andres-rad
approved these changes
Jul 20, 2026
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.
What
Adds unit tests for the pure modules extracted in W-23516605 (#130), expanding the Group A unit lane.
No
src/changes — additive tests only, nodwlibrequired.Tests added
tests/unit/reader.test.tscreateChunkReaderover sync & async iterables — bufSize boundary slicing, empty input, empty-buffer skipping,Uint8Arraychunks, copy semantics, async pre-buffering, input-error-as-EOFtests/unit/stream.test.tsstreamFromNativebridge — chunk ordering, the park-then-wake backpressure path, drain-after-done, and success/failure/empty terminal-metadata propagation (native call injected, no addon)tests/unit/errors.test.tsDataWeaveError/DataWeaveScriptError— name,instanceofchain, message fallback, attached resultResults
npm run test:unit→ 60 passed (was 35)src/**: ~39% → ~72% (errors.ts100%,reader.ts100%,stream.ts~95%)dataweave.ts/index.tsremain integration-lane surface (Group B), by designFollow-ups
Group B — integration tests (concurrency, error/edge matrix) covering
dataweave.tsGroup C — TCK harness + skip mechanism
🤖 Generated with Claude Code