-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
/
e2e.spec.js
67 lines (59 loc) · 1.23 KB
/
e2e.spec.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
jest.mock('fs')
jest.mock('inquirer')
const assertPromptModule = require('@vue/cli-test-utils/assertPromptModule')
const moduleToTest = require('../e2e')
test('cypress', async () => {
const expectedPrompts = [
{
message: 'features',
choices: ['E2E Testing'],
check: [0]
},
{
message: 'Pick an E2E testing solution',
choices: ['Cypress', 'Nightwatch'],
choose: 0
}
]
const expectedOptions = {
plugins: {
'@vue/cli-plugin-e2e-cypress': {}
}
}
await assertPromptModule(
moduleToTest,
expectedPrompts,
expectedOptions,
{ pluginsOnly: true }
)
})
test('nightwatch', async () => {
const expectedPrompts = [
{
message: 'features',
choices: ['E2E Testing'],
check: [0]
},
{
message: 'Pick an E2E testing solution',
choices: ['Cypress', 'Nightwatch'],
choose: 1
},
{
message: 'Pick browsers to run end-to-end test on',
choice: ['Chrome', 'Firefox'],
check: [0, 1]
}
]
const expectedOptions = {
plugins: {
'@vue/cli-plugin-e2e-nightwatch': {}
}
}
await assertPromptModule(
moduleToTest,
expectedPrompts,
expectedOptions,
{ pluginsOnly: true }
)
})