Skip to content

test: restructure test tooling and gate coverage#52

Merged
ungoldman merged 5 commits into
mainfrom
native-test-coverage
Jun 14, 2026
Merged

test: restructure test tooling and gate coverage#52
ungoldman merged 5 commits into
mainfrom
native-test-coverage

Conversation

@ungoldman

@ungoldman ungoldman commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Reorganizes the test setup and enforces coverage in CI: specs move out of src/ into test/, the single tsconfig splits into a build config and a separate noEmit typecheck config, and a 100% coverage gate now runs on every build.

Changes

  • Move specs from src/ to test/ (index.spec.ts to index.test.ts), with imports pointed at ../src using .js extensions (the same NodeNext convention the source uses for its self-imports).
  • tsconfig.json becomes the build config (emits src); new tsconfig.test.json is the noEmit typecheck that includes the tests. Remove tsconfig.build.json.
  • Add a coverage script on Node's built-in coverage (no c8): lines, branches, and functions gated at 100%, excluding test/.
  • npm test becomes the aggregate (lint && typecheck && build && run); drop the redundant check script. CI runs npm test, npm run coverage, and npm run test:pack, which also takes npx publint out of CI.
  • Drop *.json from Biome's scope so it stops formatting package.json (fixpack owns that).

Verification

npm test, npm run coverage (100%), and npm run test:pack pass locally.

tsx stays: native type stripping can't resolve the .js to .ts rewrite that tsc's NodeNext self-imports require (index.ts imports ./factory.js). Built-in coverage works through it with correct source maps. The published artifact (dist/*.js and dist/*.d.ts) uses .js imports throughout; no .ts extensions ship.

Drop *.json from Biome's includes. It made Biome a second formatter
for package.json (fixpack owns that) and reformatted the config JSON
to its own line width. Biome now scopes to src and test only;
package-lock.json was already auto-ignored.
@ungoldman ungoldman force-pushed the native-test-coverage branch from 26401e0 to b9840fe Compare June 14, 2026 00:36
@ungoldman ungoldman changed the title test: gate coverage at 100% and align layout test: move specs to test/ and gate coverage Jun 14, 2026
@ungoldman ungoldman changed the title test: move specs to test/ and gate coverage test: restructure test tooling and gate coverage Jun 14, 2026
Relocate index.spec.ts to test/index.test.ts and point its imports at
../src. Matches the standard's layout (specs in test/, not co-located
in src/).
tsconfig.json becomes the build config that emits src; new
tsconfig.test.json is the noEmit typecheck that adds the tests. Remove
tsconfig.build.json. typecheck runs against the test config, build is
plain tsc with a prebuild clean.
Use Node's built-in coverage (no c8), holding lines, branches, and
functions at 100% and excluding test/.
Make npm test the aggregate (lint, typecheck, build, run), matching
the standard, and drop the redundant check script. CI runs npm test,
npm run coverage, and npm run test:pack as steps, which also removes
npx publint (unpinned remote code) from CI. Repoint prerelease off
check.
@ungoldman ungoldman force-pushed the native-test-coverage branch from b9840fe to 2add2e8 Compare June 14, 2026 00:56
@ungoldman ungoldman merged commit bb328da into main Jun 14, 2026
2 checks passed
@ungoldman ungoldman deleted the native-test-coverage branch June 14, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant