Skip to content

Commit 85e583c

Browse files
Merge pull request #1921 from maxmind/jest-to-vitest
Migrate Jest to vitest
2 parents c493023 + 34069f7 commit 85e583c

37 files changed

Lines changed: 4063 additions & 12781 deletions

‎.github/workflows/test.yml‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,19 @@ jobs:
1919
with:
2020
node-version: ${{ matrix.version }}
2121
- run: npm ci
22-
- run: npm test --coverage
22+
- run: npm run test:coverage
2323
- run: npm run build
2424
- run: npm run build:docs
2525
- run: npm link
2626
- run: npm ci
2727
working-directory: e2e/js
2828
- run: npm link '@maxmind/minfraud-api-node'
2929
working-directory: e2e/js
30-
- run: npx jest
30+
- run: npx vitest run
3131
working-directory: e2e/js
32-
env:
33-
NODE_OPTIONS: --experimental-vm-modules
3432
- run: npm ci
3533
working-directory: e2e/ts
3634
- run: npm link '@maxmind/minfraud-api-node'
3735
working-directory: e2e/ts
38-
- run: npx jest
36+
- run: npx vitest run
3937
working-directory: e2e/ts
40-
env:
41-
NODE_OPTIONS: --experimental-vm-modules

‎CLAUDE.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The library is server-side only and provides strongly-typed request/response mod
1616
- TypeScript with strict type checking
1717
- Node.js 22+ (targets active LTS versions)
1818
- Uses Node.js built-in `fetch` for HTTP requests
19-
- Jest for testing
19+
- Vitest for testing
2020
- ESLint + Prettier for code quality
2121
- TypeDoc for API documentation
2222
- Depends on @maxmind/geoip2-node for IP geolocation data
@@ -153,8 +153,11 @@ npm test
153153
# Run tests in watch mode
154154
npm run test:watch
155155

156+
# Run tests with coverage (100% thresholds enforced)
157+
npm run test:coverage
158+
156159
# Run specific test file
157-
npx jest src/webServiceClient.spec.ts
160+
npx vitest run src/webServiceClient.spec.ts
158161
```
159162

160163
### Linting and Building

‎e2e/js/index.spec.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, it } from 'vitest';
12
import * as minFraud from '@maxmind/minfraud-api-node';
23

34
describe('client', () => {

0 commit comments

Comments
 (0)