mirror of https://github.com/vuejs/core.git
chore(test): migrate to Vitest inline projects (#13838)
This commit is contained in:
parent
24fccb4ee4
commit
233b1250ce
|
@ -17,11 +17,11 @@
|
||||||
"format": "prettier --write --cache .",
|
"format": "prettier --write --cache .",
|
||||||
"format-check": "prettier --check --cache .",
|
"format-check": "prettier --check --cache .",
|
||||||
"test": "vitest",
|
"test": "vitest",
|
||||||
"test-unit": "vitest --project unit",
|
"test-unit": "vitest --project unit*",
|
||||||
"test-e2e": "node scripts/build.js vue -f global -d && vitest --project e2e",
|
"test-e2e": "node scripts/build.js vue -f global -d && vitest --project e2e",
|
||||||
"test-dts": "run-s build-dts test-dts-only",
|
"test-dts": "run-s build-dts test-dts-only",
|
||||||
"test-dts-only": "tsc -p packages-private/dts-built-test/tsconfig.json && tsc -p ./packages-private/dts-test/tsconfig.test.json",
|
"test-dts-only": "tsc -p packages-private/dts-built-test/tsconfig.json && tsc -p ./packages-private/dts-test/tsconfig.test.json",
|
||||||
"test-coverage": "vitest run --project unit --coverage",
|
"test-coverage": "vitest run --project unit* --coverage",
|
||||||
"prebench": "node scripts/build.js -pf esm-browser reactivity",
|
"prebench": "node scripts/build.js -pf esm-browser reactivity",
|
||||||
"prebench-compare": "node scripts/build.js -pf esm-browser reactivity",
|
"prebench-compare": "node scripts/build.js -pf esm-browser reactivity",
|
||||||
"bench": "vitest bench --project=unit --outputJson=temp/bench.json",
|
"bench": "vitest bench --project=unit --outputJson=temp/bench.json",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { defineConfig } from 'vitest/config'
|
import { configDefaults, defineConfig } from 'vitest/config'
|
||||||
import { entries } from './scripts/aliases.js'
|
import { entries } from './scripts/aliases.js'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
@ -25,9 +25,6 @@ export default defineConfig({
|
||||||
globals: true,
|
globals: true,
|
||||||
pool: 'threads',
|
pool: 'threads',
|
||||||
setupFiles: 'scripts/setup-vitest.ts',
|
setupFiles: 'scripts/setup-vitest.ts',
|
||||||
environmentMatchGlobs: [
|
|
||||||
['packages/{vue,vue-compat,runtime-dom}/**', 'jsdom'],
|
|
||||||
],
|
|
||||||
sequence: {
|
sequence: {
|
||||||
hooks: 'list',
|
hooks: 'list',
|
||||||
},
|
},
|
||||||
|
@ -49,5 +46,41 @@ export default defineConfig({
|
||||||
'packages/runtime-dom/src/components/Transition*',
|
'packages/runtime-dom/src/components/Transition*',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
projects: [
|
||||||
|
{
|
||||||
|
extends: true,
|
||||||
|
test: {
|
||||||
|
name: 'unit',
|
||||||
|
exclude: [
|
||||||
|
...configDefaults.exclude,
|
||||||
|
'**/e2e/**',
|
||||||
|
'**/{vue,vue-compat,runtime-dom}/**',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extends: true,
|
||||||
|
test: {
|
||||||
|
name: 'unit-jsdom',
|
||||||
|
include: ['packages/{vue,vue-compat,runtime-dom}/**/*.{test,spec}.*'],
|
||||||
|
exclude: [...configDefaults.exclude, '**/e2e/**'],
|
||||||
|
environment: 'jsdom',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extends: true,
|
||||||
|
test: {
|
||||||
|
name: 'e2e',
|
||||||
|
environment: 'jsdom',
|
||||||
|
poolOptions: {
|
||||||
|
threads: {
|
||||||
|
singleThread: !!process.env.CI,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
include: ['packages/vue/__tests__/e2e/*.spec.ts'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
import { mergeConfig } from 'vitest/config'
|
|
||||||
import config from './vitest.config'
|
|
||||||
|
|
||||||
export default mergeConfig(config, {
|
|
||||||
test: {
|
|
||||||
name: 'e2e',
|
|
||||||
poolOptions: {
|
|
||||||
threads: {
|
|
||||||
singleThread: !!process.env.CI,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
include: ['packages/vue/__tests__/e2e/*.spec.ts'],
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,9 +0,0 @@
|
||||||
import { configDefaults, mergeConfig } from 'vitest/config'
|
|
||||||
import config from './vitest.config'
|
|
||||||
|
|
||||||
export default mergeConfig(config, {
|
|
||||||
test: {
|
|
||||||
name: 'unit',
|
|
||||||
exclude: [...configDefaults.exclude, '**/e2e/**'],
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,6 +0,0 @@
|
||||||
import { defineWorkspace } from 'vitest/config'
|
|
||||||
|
|
||||||
export default defineWorkspace([
|
|
||||||
'./vitest.unit.config.ts',
|
|
||||||
'./vitest.e2e.config.ts',
|
|
||||||
])
|
|
Loading…
Reference in New Issue