Skip to content

Commit 692d463

Browse files
author
Guillaume Chau
committed
feat(ui): jest task
1 parent bc59637 commit 692d463

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = api => {
2+
api.describeTask({
3+
match: /vue-cli-service test:unit/,
4+
description: 'jest.tasks.test.description',
5+
link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-jest#injected-commands',
6+
prompts: [
7+
{
8+
name: 'watch',
9+
type: 'confirm',
10+
description: 'jest.tasks.test.watch'
11+
},
12+
{
13+
name: 'notify',
14+
type: 'confirm',
15+
description: 'jest.tasks.test.notify',
16+
when: answers => answers.watch
17+
},
18+
{
19+
name: 'update',
20+
type: 'confirm',
21+
description: 'jest.tasks.test.update'
22+
}
23+
],
24+
onBeforeRun: ({ answers, args }) => {
25+
if (answers.watch) args.push('--watch')
26+
if (answers.notify) args.push('--notify')
27+
if (answers.update) args.push('--updateSnapshot')
28+
}
29+
})
30+
}

packages/@vue/cli-ui/locales/en.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,5 +511,15 @@
511511
"url": "Run e2e tests against given url instead of auto-starting dev server"
512512
}
513513
}
514+
},
515+
"jest": {
516+
"tasks": {
517+
"test": {
518+
"description": "Run unit tests with Jestks",
519+
"watch": "Watch files for changes and rerun tests related to changed files",
520+
"notify": "Display a notification after each run",
521+
"update": "Re-record every snapshot that fails during this test run"
522+
}
523+
}
514524
}
515525
}

packages/@vue/cli-ui/src/style/main.styl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,9 @@ ansi-colors('white', $vue-ui-color-light)
152152
height 1px
153153
background rgba($vue-ui-color-dark, .1)
154154
margin ($padding-item / 2) 0
155+
156+
.vue-ui-modal
157+
&.anchor
158+
align-items flex-start
159+
.shell
160+
margin-top 42px

packages/@vue/cli-ui/src/views/ProjectTaskDetails.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
<VueModal
107107
v-if="showParameters"
108108
:title="$t('views.project-task-details.parameters')"
109-
class="medium"
109+
class="medium anchor"
110110
@close="showParameters = false"
111111
>
112112
<div class="default-body">

0 commit comments

Comments
 (0)