Skip to content

build: migrate test runner from AVA to Vitest#246

Open
edmundmiller wants to merge 1 commit into
masterfrom
migrate-vitest
Open

build: migrate test runner from AVA to Vitest#246
edmundmiller wants to merge 1 commit into
masterfrom
migrate-vitest

Conversation

@edmundmiller

Copy link
Copy Markdown
Collaborator

Summary

Replaces AVA (+ @ava/typescript compiled-JS runner + c8) with Vitest + @vitest/coverage-v8.

  • Vitest runs test/functions.test.ts directly — no more testing against compiled lib/test/**/*.js
  • vitest.config.ts carries over all AVA behavior: RUNNER_TEMP=./.tmp, 120s timeout, serial execution
  • test.macro converted to a plain async helper; t.is/t.regexexpect().toBe()/toMatch() — all 8 test titles and assertions unchanged
  • eslint-plugin-ava and its config block removed

CI / Codecov

No workflow changes needed: npm test name is unchanged and coverage still lands at coverage/lcov.info.

Validation

  • All 8 tests pass (including the real-download "Install Nextflow" test)
  • Coverage compared line-by-line against a pre-migration AVA+c8 baseline run: identical covered/uncovered code paths in src/functions.ts (raw totals differ only because v8 counts executable statements while c8 counted all lines)
  • npm run build and npm run lint clean

Replace AVA + @ava/typescript + c8 with Vitest + @vitest/coverage-v8.

- Run TypeScript tests directly, no compile-to-lib step needed
- vitest.config.ts carries over AVA behavior: RUNNER_TEMP env,
  120s timeout, serial file execution
- Convert test.macro to a plain async helper; t.is/t.regex to expect
- Rename test/functions.ts -> test/functions.test.ts
- Coverage still lands at coverage/lcov.info for Codecov
- Drop eslint-plugin-ava and its config block
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