Skip to content

Commit

Permalink
feat(ui): mocha task
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Jun 14, 2018
1 parent 0ea3a22 commit b0ed1e2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/@vue/cli-plugin-unit-mocha/ui.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = api => {
api.describeTask({
match: /vue-cli-service test:unit/,
description: 'mocha.tasks.test.description',
link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-mocha#injected-commands',
prompts: [
{
name: 'watch',
type: 'confirm',
default: false,
description: 'mocha.tasks.test.watch'
}
],
onBeforeRun: ({ answers, args }) => {
if (answers.watch) args.push('--watch')
}
})
}
8 changes: 8 additions & 0 deletions packages/@vue/cli-ui/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,5 +543,13 @@
"update": "Re-record every snapshot that fails during this test run"
}
}
},
"mocha": {
"tasks": {
"test": {
"description": "Run unit tests with Mocha",
"watch": "Watch files for changes and rerun tests related to changed files"
}
}
}
}

0 comments on commit b0ed1e2

Please sign in to comment.