-
Notifications
You must be signed in to change notification settings - Fork 12
Convert test infrastructure from Karma/Mocha/Chai to Vitest with Playwright #68
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 <3026298+dgreif@users.noreply.github.com>
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
.github/workflows/nodejs.yml
Outdated
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: '.node-version' | ||
| node-version: 24 |
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 revert to using node-version-file in the CI workflows. Then update .node-version contents to 24
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.
Done in commit above. Both workflows now use node-version-file: '.node-version' and .node-version contains 24.
package.json
Outdated
| "overrides": [ | ||
| { | ||
| "files": [ | ||
| "test/**/*.js" | ||
| ], | ||
| "rules": { | ||
| "import/named": "off" | ||
| } | ||
| } |
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 Move this into test/.eslintrc.json
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.
Done in commit above. Created test/.eslintrc.json with the import/named rule override and removed the overrides section from package.json.
… remove undici-types Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
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 successfully migrates the test infrastructure from Karma/Chai/Mocha to Vitest with Playwright browser mode, upgrading to Node 24 and modernizing the CI/CD workflows.
- Replaced Karma/Chai/Mocha testing stack with Vitest ^3.2.4 and Playwright
- Updated all test assertions from Chai syntax to Vitest expect() syntax
- Modernized GitHub workflows to use Node 24 and latest actions
Reviewed Changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | New Vitest configuration with Playwright chromium browser support |
| test/test.js | Converted test imports and assertions from Mocha/Chai to Vitest |
| test/.eslintrc.json | Updated ESLint config to remove Mocha globals and add Vitest rules |
| package.json | Replaced Karma/Chai/Mocha dependencies with Vitest and Playwright |
| karma.config.js | Removed obsolete Karma configuration file |
| .node-version | Updated Node version from 22 to 24 |
| .github/workflows/publish.yml | Added Playwright installation and build/lint steps |
| .github/workflows/nodejs.yml | Added Playwright installation and lint step |
Comments suppressed due to low confidence (1)
test/test.js:1
- Similar to the previous test, this Promise resolves on the first change event from any checkbox. If multiple checkboxes exist, this could lead to race conditions or incomplete test verification.
import {describe, it, beforeAll, expect} from 'vitest'
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Migration from Karma/Chai/Mocha to Vitest with Playwright - COMPLETED ✅
Summary:
Successfully migrated the test infrastructure from Karma/Chai/Mocha to Vitest with Playwright browser mode. All requirements have been met and verified.
Changes Completed:
npx playwright install chromium --only-shellstep in CI workflowsVerification:
✅ All 14 tests passing
✅ Lint passing (no errors)
✅ Build passing
✅ No references to karma/mocha/chai remain in source files
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.