Skip to content

Migrate test.js to TypeScript ESM#58

Merged
JamieMagee merged 1 commit intomasterfrom
typescript-tests
Apr 7, 2026
Merged

Migrate test.js to TypeScript ESM#58
JamieMagee merged 1 commit intomasterfrom
typescript-tests

Conversation

@JamieMagee
Copy link
Copy Markdown
Contributor

Converts test.js to test.mts so the test file is type-checked against the .d.ts declarations from #56. Also wires up tsc in CI so type errors don't slip through.

  • Rename test.js -> test.mts, replace require() with ESM imports
  • Add type annotations to test data (Map generics, tuples, callback params)
  • Add @tsconfig/strictest and @types/node as dev dependencies
  • Add npm run typecheck step to CI after npm test
  • Pin dependency versions

Node 24 runs .mts directly via type stripping, so no build step or tsx needed.

Comment thread package.json Outdated
- Rename test.js to test.mts with ESM imports
- Add type annotations for test data (SpdxExpression, tuples)
- Extend tsconfig with @tsconfig/strictest
- Add @types/node and npm run typecheck step to CI
@JamieMagee JamieMagee merged commit 8769c07 into master Apr 7, 2026
1 check passed
@JamieMagee JamieMagee deleted the typescript-tests branch April 7, 2026 23:20
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.

2 participants