test: restructure test tooling and gate coverage#52
Merged
Conversation
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.
26401e0 to
b9840fe
Compare
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.
b9840fe to
2add2e8
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.
Reorganizes the test setup and enforces coverage in CI: specs move out of
src/intotest/, the single tsconfig splits into a build config and a separatenoEmittypecheck config, and a 100% coverage gate now runs on every build.Changes
src/totest/(index.spec.tstoindex.test.ts), with imports pointed at../srcusing.jsextensions (the same NodeNext convention the source uses for its self-imports).tsconfig.jsonbecomes the build config (emitssrc); newtsconfig.test.jsonis thenoEmittypecheck that includes the tests. Removetsconfig.build.json.coveragescript on Node's built-in coverage (no c8): lines, branches, and functions gated at 100%, excludingtest/.npm testbecomes the aggregate (lint && typecheck && build && run); drop the redundantcheckscript. CI runsnpm test,npm run coverage, andnpm run test:pack, which also takesnpx publintout of CI.*.jsonfrom Biome's scope so it stops formattingpackage.json(fixpack owns that).Verification
npm test,npm run coverage(100%), andnpm run test:packpass locally.tsx stays: native type stripping can't resolve the
.jsto.tsrewrite that tsc's NodeNext self-imports require (index.tsimports./factory.js). Built-in coverage works through it with correct source maps. The published artifact (dist/*.jsanddist/*.d.ts) uses.jsimports throughout; no.tsextensions ship.