forked from vuejs/vue-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
459 additions
and
737 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,33 @@ | ||
module.exports = api => { | ||
api.registerCommand('test', { | ||
description: 'run unit tests with jest' | ||
}, args => { | ||
description: 'run unit tests with jest', | ||
usage: 'vue-cli-service test [options] <regexForTestFiles>', | ||
options: { | ||
'--watch': 'run tests in watch mode' | ||
}, | ||
details: | ||
`All jest command line options are supported.\n` + | ||
`See https://facebook.github.io/jest/docs/en/cli.html for more details.` | ||
}, (args, rawArgv) => { | ||
api.setMode('test') | ||
// for @vue/babel-preset-app | ||
process.env.VUE_CLI_BABEL_TARGET_NODE = true | ||
process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true | ||
|
||
// TODO execa jest w/ --config jest.config.js | ||
const execa = require('execa') | ||
const jestBinPath = require.resolve('jest/bin/jest') | ||
|
||
return new Promise((resolve, reject) => { | ||
const child = execa(jestBinPath, rawArgv, { stdio: 'inherit' }) | ||
child.on('error', reject) | ||
child.on('exit', code => { | ||
if (code !== 0) { | ||
reject(`jest exited with code ${code}.`) | ||
} else { | ||
resolve() | ||
} | ||
}) | ||
}) | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.