Skip to content

Commit a76bde1

Browse files
committed
test: do not call process.exit during tests
1 parent f83f31a commit a76bde1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/@vue/cli-shared-utils/lib/exit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports.exitProcess = !process.env.VUE_CLI_API_MODE
1+
exports.exitProcess = !process.env.VUE_CLI_API_MODE && !process.env.VUE_CLI_TEST
22

33
exports.exit = function (code) {
44
if (exports.exitProcess) {

packages/@vue/cli/lib/create.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ module.exports = (...args) => {
7474
return create(...args).catch(err => {
7575
stopSpinner(false) // do not persist
7676
error(err)
77-
process.exit(1)
77+
if (!process.env.VUE_CLI_TEST) {
78+
process.exit(1)
79+
}
7880
})
7981
}

0 commit comments

Comments
 (0)