Skip to content

Commit

Permalink
test: switch to vitest (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Aug 28, 2022
1 parent c81101c commit 2054309
Show file tree
Hide file tree
Showing 8 changed files with 907 additions and 2,872 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -7,6 +7,6 @@ LICENSE.md @kyranet @favna @vladfrangu
/.vscode/ @favna
/.all-contributorsrc @favna
.npm-deprecaterc.yml @favna
jest.config.mjs @favna
vitest.config.ts @favna
package.json @favna
README.md @favna
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [12, 14, 15, 16, 17]
node: [14, 16]
os: [ubuntu-18.04, ubuntu-20.04, macos-latest, windows-latest]
include:
- node: 18
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [12, 14, 15, 16, 17]
node: [14, 16]
os: [ubuntu-18.04, ubuntu-20.04, macos-latest, windows-latest]
include:
- node: 18
Expand Down
14 changes: 0 additions & 14 deletions jest.config.mjs

This file was deleted.

9 changes: 4 additions & 5 deletions package.json
Expand Up @@ -17,7 +17,7 @@
"scripts": {
"clean": "node scripts/clean.mjs",
"docs": "typedoc",
"test": "yarn gyp:configure && yarn gyp:build && jest",
"test": "yarn gyp:configure && yarn gyp:build && vitest run",
"lint": "eslint src tests --ext ts --fix",
"build": "yarn gyp:configure && yarn ts:build && yarn gyp:build && gen-esm-wrapper dist/index.js dist/index.mjs",
"bump": "cliff-jumper",
Expand Down Expand Up @@ -53,24 +53,23 @@
"@sapphire/eslint-config": "^4.3.8",
"@sapphire/prettier-config": "^1.4.4",
"@sapphire/ts-config": "^3.3.4",
"@types/jest": "^28.1.8",
"@types/node": "^17.0.31",
"@typescript-eslint/eslint-plugin": "^5.35.1",
"@typescript-eslint/parser": "^5.35.1",
"@vitest/coverage-c8": "^0.22.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.23.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"gen-esm-wrapper": "^1.1.3",
"husky": "^8.0.1",
"jest": "^28.1.3",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"ts-jest": "^28.0.8",
"typedoc": "^0.23.11",
"typedoc-plugin-mdn-links": "^2.0.0",
"typescript": "^4.8.2"
"typescript": "^4.8.2",
"vitest": "^0.22.1"
},
"files": [
"lib",
Expand Down
3 changes: 2 additions & 1 deletion tests/tsconfig.json
Expand Up @@ -4,7 +4,8 @@
"target": "ES2020",
"rootDir": "./",
"outDir": "./build",
"tsBuildInfoFile": "./build/.tsbuildinfo"
"tsBuildInfoFile": "./build/.tsbuildinfo",
"types": ["vitest/globals"]
},
"include": ["./", "../src/node-pre-gyp.d.ts"],
"references": [{ "path": "../src" }]
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.eslint.json
Expand Up @@ -4,5 +4,5 @@
"allowJs": true,
"checkJs": true
},
"include": ["src", "tests", "jest.setup.mjs"]
"include": ["src", "tests", "vitest.config.ts"]
}
15 changes: 15 additions & 0 deletions vitest.config.ts
@@ -0,0 +1,15 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
threads: false,
globals: true,
coverage: {
enabled: true,
reporter: ['text', 'lcov', 'clover']
}
},
esbuild: {
target: 'es2020'
}
});

0 comments on commit 2054309

Please sign in to comment.