forked from vuejs/vue-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunit.spec.js
62 lines (54 loc) · 1.08 KB
/
unit.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
jest.mock('fs')
jest.mock('inquirer')
const assertPromptModule = require('@vue/cli-test-utils/assertPromptModule')
const moduleToTest = require('../unit')
test('mocha', async () => {
const expectedPrompts = [
{
message: 'features',
choices: ['Unit Testing'],
check: [0]
},
{
message: 'Pick a unit testing solution',
choices: ['Jest', 'Mocha'],
choose: 0
}
]
const expectedOptions = {
plugins: {
'@vue/cli-plugin-unit-jest': {}
}
}
await assertPromptModule(
moduleToTest,
expectedPrompts,
expectedOptions,
{ pluginsOnly: true }
)
})
test('jest', async () => {
const expectedPrompts = [
{
message: 'features',
choices: ['Unit Testing'],
check: [0]
},
{
message: 'Pick a unit testing solution',
choices: ['Jest', 'Mocha'],
choose: 1
}
]
const expectedOptions = {
plugins: {
'@vue/cli-plugin-unit-mocha': {}
}
}
await assertPromptModule(
moduleToTest,
expectedPrompts,
expectedOptions,
{ pluginsOnly: true }
)
})