Fix internal driver tests exiting with wrong exitCode (#7078)

* use error.exitCode in cypress:run script

* add log if code is NaN

* expect exitCode in .then too
This commit is contained in:
Zach Bloomquist
2020-04-20 14:57:31 -04:00
committed by GitHub
parent 6cbeda8f37
commit 4f127e9368

View File

@@ -16,8 +16,12 @@ debug('starting the CLI in dev mode with args %o', {
args,
})
const exit = ({ code }) => {
process.exit(code)
const exit = ({ exitCode }) => {
if (typeof code !== 'number') {
throw new Error(`missing exit code from execa (received ${exitCode})`)
}
process.exit(exitCode)
}
execa(pathToCli, args, { stdio: 'inherit' })