-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.js
39 lines (37 loc) · 946 Bytes
/
ui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @module vue-cli-plugin-unit-ava/ui
* @see {@link https://cli.vuejs.org/dev-guide/plugin-dev.html#ui-integration}
*/
/**
* @external uiApi
* @see {@link https://cli.vuejs.org/dev-guide/ui-api.html}
*/
/**
* UI integration function
* @param {uiAPi} api
*/
module.exports = api => {
api.describeTask({
match: /vue-cli-service test:unit/,
description: 'org.dnlup.ava.tasks.test.description',
link: 'https://github.com/dnlup/vue-cli-plugin-unit-ava',
prompts: [
{
name: 'watch',
type: 'confirm',
default: false,
description: 'org.dnlup.ava.tasks.test.watch'
},
{
name: 'update',
type: 'confirm',
default: false,
description: 'org.dnlup.ava.tasks.test.update'
}
],
onBeforeRun: ({ answers, args }) => {
if (answers.watch) args.push('--watch')
if (answers.update) args.push('--update-snapshots')
}
})
}