Skip to content

Commit

Permalink
feat(ui): jest task
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Jun 11, 2018
1 parent bc59637 commit 692d463
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
30 changes: 30 additions & 0 deletions packages/@vue/cli-plugin-unit-jest/ui.js
Original file line number Diff line number Diff line change
@@ -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')
}
})
}
10 changes: 10 additions & 0 deletions packages/@vue/cli-ui/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
6 changes: 6 additions & 0 deletions packages/@vue/cli-ui/src/style/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion packages/@vue/cli-ui/src/views/ProjectTaskDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 692d463

Please sign in to comment.