mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-02-28 19:38:43 -06:00
refactor: simplify test script
This commit is contained in:
12
package.json
12
package.json
@@ -28,14 +28,9 @@
|
||||
"setupFiles": [
|
||||
"<rootDir>/scripts/testSetup.js"
|
||||
],
|
||||
"testPathIgnorePatterns": [
|
||||
"/template/",
|
||||
"/packages/test/",
|
||||
"/temp/",
|
||||
"/scripts/",
|
||||
".*.helper.js"
|
||||
],
|
||||
"testMatch": ["**/*.spec.js"]
|
||||
"testMatch": [
|
||||
"**/*.spec.js"
|
||||
]
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,vue}": [
|
||||
@@ -63,6 +58,7 @@
|
||||
"lerna": "^2.8.0",
|
||||
"lint-staged": "^7.2.0",
|
||||
"memfs": "^2.8.0",
|
||||
"minimist": "^1.2.0",
|
||||
"puppeteer": "^1.0.0",
|
||||
"request": "^2.83.0",
|
||||
"request-promise-native": "^1.0.5",
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
const execa = require('execa')
|
||||
const minimist = require('minimist')
|
||||
|
||||
const rawArgs = process.argv.slice(2)
|
||||
const args = minimist(rawArgs)
|
||||
|
||||
@@ -12,18 +10,13 @@ if (args.p) {
|
||||
rawArgs.splice(i, 2)
|
||||
}
|
||||
|
||||
;(async () => {
|
||||
const jestArgs = [
|
||||
'--env', 'node',
|
||||
'--runInBand',
|
||||
...rawArgs,
|
||||
...(regex ? [regex] : [])
|
||||
]
|
||||
console.log(`running jest with args: ${jestArgs.join(' ')}`)
|
||||
await execa('jest', jestArgs, {
|
||||
stdio: 'inherit'
|
||||
})
|
||||
})().catch(err => {
|
||||
err
|
||||
process.exit(1)
|
||||
})
|
||||
const jestArgs = [
|
||||
'--env', 'node',
|
||||
'--runInBand',
|
||||
...rawArgs,
|
||||
...(regex ? [regex] : [])
|
||||
]
|
||||
|
||||
console.log(`running jest with args: ${jestArgs.join(' ')}`)
|
||||
|
||||
require('jest').run(jestArgs)
|
||||
|
||||
Reference in New Issue
Block a user