Skip to content

Convert tests to TypeScript and use Vitest with coverage#35

Merged
tomkp merged 1 commit intomasterfrom
feat/vitest-typescript-tests
Dec 28, 2025
Merged

Convert tests to TypeScript and use Vitest with coverage#35
tomkp merged 1 commit intomasterfrom
feat/vitest-typescript-tests

Conversation

@tomkp
Copy link
Copy Markdown
Owner

@tomkp tomkp commented Dec 28, 2025

Summary

  • Migrates test files from JavaScript to TypeScript with proper type annotations
  • Replaces Node.js built-in test runner with Vitest for modern testing features
  • Adds code coverage using @vitest/coverage-v8
  • Adds vitest.config.ts with text, html, and lcov reporters
  • Updates package.json with new test scripts
  • Removes PC/SC library dependency from CI workflow (no longer needed without smartcard)

Test Coverage

File               | % Stmts | % Branch | % Funcs | % Lines
-------------------|---------|----------|---------|--------
All files          |   92.98 |      100 |   86.66 |   92.98
 command-apdu.ts   |     100 |      100 |     100 |     100
 iso7816-app.ts    |   86.36 |      100 |   66.66 |   86.36
 response-apdu.ts  |   95.45 |      100 |   92.85 |   95.45

Test plan

  • All 35 tests pass with npm test
  • Coverage report generates with npm run test:coverage
  • TypeScript types are correct
  • ESLint and Prettier pass

Fixes #34

- Migrate test files from JavaScript to TypeScript
- Replace Node.js test runner with Vitest
- Add @vitest/coverage-v8 for code coverage
- Add vitest.config.ts with v8 coverage provider
- Update package.json scripts: test, test:watch, test:coverage
- Add /coverage to .gitignore
- Remove PC/SC library install from CI (no longer needed)

Fixes #34
@tomkp tomkp merged commit 6dd740f into master Dec 28, 2025
3 checks passed
@tomkp tomkp deleted the feat/vitest-typescript-tests branch December 28, 2025 16:06
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.

Convert tests to TypeScript and use Vitest with coverage

1 participant