-
Notifications
You must be signed in to change notification settings - Fork 8
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: dgreif <[email protected]>
Co-authored-by: dgreif <[email protected]>
Co-authored-by: dgreif <[email protected]>
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 or learn how to get started.
.github/workflows/nodejs.yml
Outdated
with: | ||
node-version: 22 | ||
node-version: 24 | ||
- run: npx playwright install chromium |
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.
@copilot we actually don't need playwright since we aren't using browser mode. Remove all installs in ci
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.
Removed playwright install steps from both nodejs.yml and publish.yml workflows. (commit: will be included in next push)
Co-authored-by: dgreif <[email protected]>
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.
🙌
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:
publish.yml:
Both 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! Click here to start the survey.