Skip to content

Commit 89a8403

Browse files
authored
fix: use a standalone config file for the vitest (vuejs#227)
Co-authored-by: Haoqun Jiang <haoqunjiang@gmail.com> Fixes vuejs#221 Fixes vuejs#199
1 parent 9fde3d1 commit 89a8403

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

template/config/vitest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"scripts": {
3-
"test:unit": "vitest --environment jsdom --root src/"
3+
"test:unit": "vitest"
44
},
55
"dependencies": {
66
"vue": "^3.2.47"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { fileURLToPath } from 'node:url'
2+
import { mergeConfig } from 'vite'
3+
import { configDefaults, defineConfig } from 'vitest/config'
4+
import viteConfig from './vite.config'
5+
6+
export default mergeConfig(
7+
viteConfig,
8+
defineConfig({
9+
test: {
10+
environment: 'jsdom',
11+
exclude: [...configDefaults.exclude, 'e2e/*'],
12+
root: fileURLToPath(new URL('./', import.meta.url))
13+
}
14+
})
15+
)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy