Skip to content

Commit

Permalink
jest => vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzogg committed Jun 18, 2024
1 parent 60775fc commit bc7eec3
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
node-version: '16'
- run: npm install
- run: npm test
- run: npm test -- --run --no-cache
node18:
name: Node 18
runs-on: ubuntu-22.04
Expand All @@ -32,7 +32,7 @@ jobs:
with:
node-version: '18'
- run: npm install
- run: npm test
- run: npm test -- --run --no-cache
node20:
name: Node 20
runs-on: ubuntu-22.04
Expand All @@ -46,7 +46,7 @@ jobs:
- run: npm install
- run: npm run lint
- run: npm run cs
- run: npm test -- --coverage --no-cache
- run: npm test -- --run --coverage --no-cache
- run: npm run infection
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
Expand Down
15 changes: 0 additions & 15 deletions jest.config.cjs

This file was deleted.

22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"repository": "chubbyts/chubbyts-http-error",
"scripts": {
"build": "node ./build.js",
"cs-fix": "./node_modules/prettier/bin/prettier.cjs --write src tests",
"cs": "./node_modules/prettier/bin/prettier.cjs --check src tests",
"cs-fix": "prettier --write src tests",
"cs": "prettier --check src tests",
"infection": "stryker run",
"lint-fix": "eslint src tests --fix",
"lint": "eslint src tests",
"prepare": "npm run build",
"test": "jest"
"test": "vitest"
},
"prettier": {
"printWidth": 120,
Expand All @@ -44,16 +44,14 @@
"dependencies": {},
"devDependencies": {
"@chubbyts/chubbyts-eslint": "^2.0.3",
"@chubbyts/chubbyts-packaging": "^2.0.6",
"@chubbyts/chubbyts-packaging": "^2.0.7",
"@stryker-mutator/core": "^8.2.6",
"@stryker-mutator/jest-runner": "^8.2.6",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.30",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"prettier-2": "npm:prettier@^2.8.8",
"ts-jest": "^29.1.2",
"typescript": "^5.4.3"
"@stryker-mutator/vitest-runner": "^8.2.6",
"@types/node": "^20.14.5",
"@vitest/coverage-v8": "^1.6.0",
"prettier": "^3.3.2",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 4 additions & 1 deletion stryker.conf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
"testRunner": "jest",
"testRunner": "vitest",
"vitest": {
"configFile": "vitest.config.ts"
},
"coverageAnalysis": "off",
"reporters": [
"clear-text",
Expand Down
2 changes: 1 addition & 1 deletion tests/http-error.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import {
createBadGateway,
createBadRequest,
Expand Down
19 changes: 19 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['tests/**/*.test.*'],
coverage: {
all: true,
clean: true,
reporter: ['clover', ['html', { subdir: 'html' }], 'json', 'lcovonly', 'text'],
provider: 'v8',
thresholds: {
lines: 100,
},
include: ['src/**/*.ts'],
},
},
});

0 comments on commit bc7eec3

Please sign in to comment.