Skip to content

Commit f2702e3

Browse files
committed
Replace jest with vitest
1 parent 5aadd07 commit f2702e3

File tree

3 files changed

+333
-2002
lines changed

3 files changed

+333
-2002
lines changed

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"docs:dev": "vuepress dev docs",
3030
"docs:build": "vuepress build docs",
3131
"lint": "eslint --fix src",
32-
"test": "vite-jest --no-cache"
32+
"test": "vitest run"
3333
},
3434
"dependencies": {
3535
"vue": "^3.2.41"
@@ -43,12 +43,11 @@
4343
"eslint-config-prettier": "^8.3.0",
4444
"eslint-plugin-prettier": "^4.0.0",
4545
"eslint-plugin-vue": "^8.4.1",
46-
"jest": "^27.5.1",
47-
"jest-environment-jsdom": "^27.5.1",
46+
"jsdom": "^20.0.2",
4847
"postcss": "^8.4.18",
4948
"tailwindcss": "^3.2.1",
5049
"vite": "^3.2.2",
51-
"vite-jest": "^0.1.4",
50+
"vitest": "^0.24.5",
5251
"vuepress": "^2.0.0-beta.53"
5352
}
5453
}

vite.config.js

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,30 @@ import vue from '@vitejs/plugin-vue';
44
import { fileURLToPath } from 'url';
55

66
// https://vitejs.dev/config/
7-
export default defineConfig(({ mode }) => {
8-
if (mode === 'app') {
9-
return {
10-
plugins: [vue()],
11-
};
12-
} else {
13-
return {
14-
plugins: [vue()],
15-
resolve: {
16-
alias: {
17-
'@': fileURLToPath(new URL('./src', import.meta.url)),
7+
export default defineConfig({
8+
plugins: [vue()],
9+
resolve: {
10+
alias: {
11+
'@': fileURLToPath(new URL('./src', import.meta.url)),
12+
},
13+
},
14+
build: {
15+
lib: {
16+
entry: path.resolve(__dirname, 'src/lib.js'),
17+
name: 'LaravelVuePagination',
18+
fileName: (format) => `laravel-vue-pagination.${format}.js`,
19+
},
20+
rollupOptions: {
21+
external: ['vue'],
22+
output: {
23+
globals: {
24+
vue: 'Vue',
1825
},
1926
},
20-
build: {
21-
lib: {
22-
entry: path.resolve(__dirname, 'src/lib.js'),
23-
name: 'LaravelVuePagination',
24-
fileName: (format) => `laravel-vue-pagination.${format}.js`,
25-
},
26-
rollupOptions: {
27-
external: ['vue'],
28-
output: {
29-
globals: {
30-
vue: 'Vue',
31-
},
32-
},
33-
},
34-
},
35-
};
36-
}
27+
},
28+
},
29+
test: {
30+
globals: true,
31+
environment: 'jsdom',
32+
},
3733
});

0 commit comments

Comments
 (0)