Skip to content

Commit 9ebab36

Browse files
Merge pull request #1329 from remarkablemark/test/vitest
test: migrate from Mocha and Karma to Vitest
2 parents 37b3016 + 3971806 commit 9ebab36

34 files changed

Lines changed: 3014 additions & 5774 deletions

.github/workflows/e2e.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: e2e
2+
on: [push, pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
e2e:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
browser: [chromium, firefox, webkit]
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v6
17+
18+
- name: Use Node.js
19+
uses: actions/setup-node@v6
20+
with:
21+
cache: npm
22+
node-version-file: .nvmrc
23+
24+
- name: Install dependencies
25+
run: npm ci --prefer-offline
26+
27+
- name: Install Playwright browsers
28+
run: npx playwright install --with-deps ${{ matrix.browser }}
29+
30+
- name: Run browser tests on Chrome
31+
run: npx vitest run --config vitest.browser.config.mts --browser=${{ matrix.browser }}

.github/workflows/test.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,13 @@ jobs:
2020
- name: Install dependencies
2121
run: npm ci --prefer-offline
2222

23-
- name: Run server test
23+
- name: Run unit tests
2424
run: npm run test:coverage
2525

26-
- name: Generate coverage report
27-
run: npx nyc report --reporter=text-lcov > coverage/lcov.info
28-
2926
- name: Upload coverage reports to Codecov
3027
uses: codecov/codecov-action@v5
3128
with:
3229
token: ${{ secrets.CODECOV_TOKEN }}
3330

3431
- name: Run module tests
3532
run: npm run test:esm
36-
37-
- name: Run client test
38-
uses: coactions/setup-xvfb@v1
39-
with:
40-
run: npm run test:client

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
npm test
1+
npm run test:coverage
22
npx lint-staged

eslint.config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ export default defineConfig([
3434

3535
languageOptions: {
3636
globals: {
37-
...globals.browser,
38-
...globals.mocha,
3937
...globals.node,
4038
},
4139
parserOptions: {

karma.conf.js

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)