- Notifications
You must be signed in to change notification settings - Fork8
Convert test framework from Mocha/Chai to Vitest and update CI workflows#35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR migrates the testing infrastructure from Mocha/Chai to Vitest v3.2.4 and updates CI workflows to use Node.js 24.
- Replaces Mocha/Chai test framework with Vitest for modern TypeScript testing
- Updates Node.js version to 24 in GitHub Actions workflows
- Removes outdated dependencies and configurations while adding Playwright support
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
vitest.config.ts | Adds Vitest configuration for TypeScript test execution |
test/index.ts | Converts Chai assertions to Vitest syntax and spy functions |
test/decorator.ts | Updates test assertions from Chai to Vitest format |
package.json | Removes Mocha/Chai dependencies, adds Vitest, updates TypeScript and Node types |
.github/workflows/publish.yml | Updates Node.js to v24 and adds Playwright installation |
.github/workflows/nodejs.yml | Updates Node.js to v24 and adds Playwright installation |
Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.
Uh oh!
There was an error while loading.Please reload this page.
This PR modernizes the testing infrastructure by migrating from Mocha/Chai to Vitest v3.2.4, and updates GitHub Actions workflows to use the latest Node.js versions.
Test Framework Migration
Removed dependencies:
mocha
,chai
,chai-spies
,ts-node
and related@types
packagesAdded:
vitest@^3.2.4
with proper TypeScript supportTest files updated:
All test files (
test/index.ts
,test/decorator.ts
) have been converted from Chai assertions to Vitest:Configuration changes:
vitest.config.ts
for Vitest configurationnode --loader ts-node/esm.mjs node_modules/mocha/lib/cli/cli.js
tovitest run
package.json
Dependency Updates
typescript
from^4.6.4
to^5.9.3
for better compatibility@types/node
from^14.0.19
to^22.18.8
to match Node.js 24 requirementsskipLibCheck: true
totsconfig.json
to handle type definitions in node_modulesGitHub Actions Workflows
nodejs.yml:
npx playwright install chromium
step before running testspublish.yml:
npx playwright install chromium
step before running testsBoth workflows already used the latest versions of
actions/checkout@v4
andactions/setup-node@v4
.Validation
All existing tests pass successfully:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.