Skip to content

Commit b0ed1e2

Browse files
author
Guillaume Chau
committed
feat(ui): mocha task
1 parent 0ea3a22 commit b0ed1e2

File tree

2 files changed

+26
-0
lines changed
  • packages/@vue

2 files changed

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

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,5 +543,13 @@
543543
"update": "Re-record every snapshot that fails during this test run"
544544
}
545545
}
546+
},
547+
"mocha": {
548+
"tasks": {
549+
"test": {
550+
"description": "Run unit tests with Mocha",
551+
"watch": "Watch files for changes and rerun tests related to changed files"
552+
}
553+
}
546554
}
547555
}

0 commit comments

Comments
 (0)