mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-02-05 22:48:27 -06:00
feat(ui): jest task
This commit is contained in:
30
packages/@vue/cli-plugin-unit-jest/ui.js
Normal file
30
packages/@vue/cli-plugin-unit-jest/ui.js
Normal file
@@ -0,0 +1,30 @@
|
||||
module.exports = api => {
|
||||
api.describeTask({
|
||||
match: /vue-cli-service test:unit/,
|
||||
description: 'jest.tasks.test.description',
|
||||
link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-jest#injected-commands',
|
||||
prompts: [
|
||||
{
|
||||
name: 'watch',
|
||||
type: 'confirm',
|
||||
description: 'jest.tasks.test.watch'
|
||||
},
|
||||
{
|
||||
name: 'notify',
|
||||
type: 'confirm',
|
||||
description: 'jest.tasks.test.notify',
|
||||
when: answers => answers.watch
|
||||
},
|
||||
{
|
||||
name: 'update',
|
||||
type: 'confirm',
|
||||
description: 'jest.tasks.test.update'
|
||||
}
|
||||
],
|
||||
onBeforeRun: ({ answers, args }) => {
|
||||
if (answers.watch) args.push('--watch')
|
||||
if (answers.notify) args.push('--notify')
|
||||
if (answers.update) args.push('--updateSnapshot')
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -511,5 +511,15 @@
|
||||
"url": "Run e2e tests against given url instead of auto-starting dev server"
|
||||
}
|
||||
}
|
||||
},
|
||||
"jest": {
|
||||
"tasks": {
|
||||
"test": {
|
||||
"description": "Run unit tests with Jestks",
|
||||
"watch": "Watch files for changes and rerun tests related to changed files",
|
||||
"notify": "Display a notification after each run",
|
||||
"update": "Re-record every snapshot that fails during this test run"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,3 +152,9 @@ ansi-colors('white', $vue-ui-color-light)
|
||||
height 1px
|
||||
background rgba($vue-ui-color-dark, .1)
|
||||
margin ($padding-item / 2) 0
|
||||
|
||||
.vue-ui-modal
|
||||
&.anchor
|
||||
align-items flex-start
|
||||
.shell
|
||||
margin-top 42px
|
||||
@@ -106,7 +106,7 @@
|
||||
<VueModal
|
||||
v-if="showParameters"
|
||||
:title="$t('views.project-task-details.parameters')"
|
||||
class="medium"
|
||||
class="medium anchor"
|
||||
@close="showParameters = false"
|
||||
>
|
||||
<div class="default-body">
|
||||
|
||||
Reference in New Issue
Block a user