Skip to content

Commit

Permalink
chore(vitest): config file move to root path (#4933)
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 authored Jan 22, 2025
1 parent 6e2d21a commit 19e6c67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@
"lint": "npm run lint:tsc && eslint --ext .vue,.js,.ts,.tsx ./src --max-warnings 0 --cache",
"lint:tsc": "tsc --emitDeclarationOnly",
"test": "npm run test:unit && npm run test:snap",
"test:unit": "vitest run --config test/unit/vitest.config.js",
"test:update": "vitest run --config test/unit/vitest.config.js -u && npm run test:snap-update",
"test:unit-dev": "vitest --config test/unit/vitest.config.js",
"test:unit-gui": "vitest --config test/unit/vitest.config.js --ui",
"test:unit-coverage": "vitest run --config test/unit/vitest.config.js --coverage",
"test:snap": "cross-env NODE_ENV=test-snap vitest run --config test/unit/vitest.config.js",
"test:snap-update": "cross-env NODE_ENV=test-snap vitest run --config test/unit/vitest.config.js -u",
"test:unit": "vitest run ",
"test:update": "vitest run -u && npm run test:snap-update",
"test:unit-dev": "vitest ",
"test:unit-gui": "vitest --ui",
"test:unit-coverage": "vitest run --coverage",
"test:snap": "cross-env NODE_ENV=test-snap vitest run ",
"test:snap-update": "cross-env NODE_ENV=test-snap vitest run -u",
"test:e2e": "cypress run --config-file test/cypress/cypress.config.js --component",
"test:e2e-gui": "cypress open --config-file test/cypress/cypress.config.js",
"robot": "publish-cli robot-msg",
Expand Down
5 changes: 2 additions & 3 deletions test/unit/vitest.config.js → vitest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as path from 'path';
import { resolveConfig, basePlugin } from '../../script/vite.base.config';
import { resolveConfig, basePlugin } from './script/vite.base.config';

// 单元测试相关配置
const testConfig = {
Expand All @@ -10,7 +9,7 @@ const testConfig = {
globals: true,
environment: 'jsdom',
testTimeout: 5000,
setupFiles: process.env.NODE_ENV === 'test-snap' ? path.resolve(__dirname, './test-setup.js') : '',
setupFiles: process.env.NODE_ENV === 'test-snap' ? './test/unit/test-setup.js' : '',
transformMode: {
web: [/\.[jt]sx$/],
},
Expand Down

0 comments on commit 19e6c67

Please sign in to comment.