Skip to content

Commit 7ecbd2a

Browse files
author
Guillaume Chau
committed
feat(ui): cypress task
1 parent 78a6ac8 commit 7ecbd2a

File tree

2 files changed

+47
-3
lines changed
  • packages/@vue

2 files changed

+47
-3
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
module.exports = api => {
2+
api.describeTask({
3+
match: /vue-cli-service test:e2e/,
4+
description: 'Run e2e tests with `cypress run`',
5+
link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-e2e-cypress#injected-commands',
6+
prompts: [
7+
{
8+
name: 'headless',
9+
type: 'confirm',
10+
default: false,
11+
description: 'Run in headless mode without GUI'
12+
},
13+
{
14+
name: 'mode',
15+
type: 'list',
16+
default: 'development',
17+
choices: [
18+
{
19+
name: 'development',
20+
value: 'development'
21+
},
22+
{
23+
name: 'production',
24+
value: 'production'
25+
},
26+
{
27+
name: 'test',
28+
value: 'test'
29+
}
30+
],
31+
description: 'Specify the mode the dev server should run in'
32+
},
33+
{
34+
name: 'url',
35+
type: 'input',
36+
default: '',
37+
description: 'Run e2e tests against given url instead of auto-starting dev server'
38+
}
39+
],
40+
onBeforeRun: ({ answers, args }) => {
41+
if (answers.headless) args.push('--headless')
42+
if (answers.mode) args.push('--mode', answers.mode)
43+
if (answers.url) args.push('--url', answers.url)
44+
}
45+
})
46+
}

packages/@vue/cli-plugin-eslint/ui.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,7 @@ module.exports = api => {
221221
}
222222
],
223223
onBeforeRun: ({ answers, args }) => {
224-
if (answers.noFix) {
225-
args.push('--no-fix')
226-
}
224+
if (answers.noFix) args.push('--no-fix')
227225
}
228226
})
229227
}

0 commit comments

Comments
 (0)