Skip to content

Commit b1c16d2

Browse files
committed
chore: 🧪 switch from jest to vitest
1 parent 8dfbf34 commit b1c16d2

File tree

6 files changed

+430
-28
lines changed

6 files changed

+430
-28
lines changed

jest.config.ts

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

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"scripts": {
8-
"test": "jest --passWithNoTests --bail --detectOpenHandles --verbose --env=jsdom",
9-
"test:watch": "jest --watchAll",
10-
"test:watch:jsdom": "jest --watchAll --env=jsdom",
8+
"test": "vitest --run",
9+
"test:watch": "yarnr test",
1110
"build": "yarn clean && tsc",
1211
"watch": "tsc -w",
1312
"start": "nodemon",
@@ -50,7 +49,6 @@
5049
"@commitlint/cli": "^17.0.0",
5150
"@commitlint/config-conventional": "^17.0.0",
5251
"@nuxt/types": "^2.15.8",
53-
"@types/jest": "^27.4.0",
5452
"@types/lodash": "^4.14.182",
5553
"@types/node": "^18.0.0",
5654
"@types/qs": "^6.9.7",
@@ -64,16 +62,16 @@
6462
"eslint-plugin-prettier": "^4.0.0",
6563
"eslint-plugin-promise": "^6.0.0",
6664
"husky": "^8.0.1",
67-
"jest": "^27.4.5",
6865
"lint-staged": ">=10",
6966
"nodemon": "^2.0.12",
7067
"nuxt-edge": "^2.16.0-27217455.034b9901",
7168
"prettier": "^2.4.1",
7269
"rimraf": "^3.0.2",
7370
"standard-version": "^9.3.1",
74-
"ts-jest": "^27.1.1",
7571
"ts-node": "^10.9.1",
7672
"typescript": "^4.5.3",
73+
"vite": "^4.0.4",
74+
"vitest": "^0.27.2",
7775
"vue": "^2.6.14"
7876
},
7977
"files": [

src/__tests__/__snapshots__/package.spec.ts.snap

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1
2+
3+
exports[`Vue Api Queries > Get errors from vue component 1`] = `
4+
{
5+
"$_vueTestUtils_original": [Circular],
6+
"_Ctor": {},
7+
"data": [Function],
8+
"name": undefined,
9+
"render": [Function],
10+
"staticRenderFns": [],
11+
"template": "
12+
<div>
13+
<input type=\\"checkbox\\" name=\\"t1\\" class=\\"foo\\" v-model=\\"t1\\" />
14+
<input type=\\"radio\\" name=\\"t2\\" class=\\"foo\\" value=\\"foo\\" v-model=\\"t2\\"/>
15+
<input type=\\"radio\\" name=\\"t2\\" class=\\"bar\\" value=\\"bar\\" v-model=\\"t2\\"/>
16+
<span id=\\"age\\">{{ $errors.first('age') }}</span>
17+
</div>",
18+
}
19+
`;
20+
21+
exports[`Vue Api Queries > Get plugin installed 1`] = `
22+
<body>
23+
<div
24+
data-app="true"
25+
/>
26+
</body>
27+
`;
228
329
exports[`Vue Api Queries Get errors from vue component 1`] = `
430
Object {

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
"types": [
2121
"@types/node",
2222
"@nuxt/types",
23-
"@types/jest",
2423
"axios",
2524
"axios-mock-adapter",
2625
"@types/qs",
27-
"@types/lodash"
26+
"@types/lodash",
27+
"vitest/globals"
2828
]
2929
},
3030
"include": ["src"],

vite.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from 'vite'
2+
3+
export default defineConfig({
4+
test: {
5+
globals: true,
6+
deps: {
7+
interopDefault: true,
8+
},
9+
environment: 'jsdom',
10+
},
11+
})

0 commit comments

Comments
 (0)