-
Notifications
You must be signed in to change notification settings - Fork 12
/
tests.js
75 lines (71 loc) · 1.45 KB
/
tests.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
68
69
70
71
72
73
74
75
const { abs } = require('../../utils')
const expected = {
'@': abs(''),
'@packages': abs('../packages'),
'@classes': abs('classes'),
'@app': abs('app'),
'@data': abs('app/data'),
'@settings': abs('app/settings.js'),
'@services': abs('app/services'),
'@views': abs('app/views'),
'@alias-hq': abs('../../src'),
}
module.exports = [
function () {
const label = 'default'
const options = {}
return { label, options, expected }
},
function () {
const label = 'object'
const options = {
format: 'object'
}
return { label, options, expected }
},
function () {
const label = 'array'
const options = {
format: 'array'
}
const expected = [
{
find: '@',
replacement: abs(''),
},
{
find: '@packages',
replacement: abs('../packages'),
},
{
find: '@classes',
replacement: abs('classes')
},
{
find: '@app',
replacement: abs('app')
},
{
find: '@data',
replacement: abs('app/data')
},
{
find: '@settings',
replacement: abs('app/settings.js')
},
{
find: '@services',
replacement: abs('app/services')
},
{
find: '@views',
replacement: abs('app/views')
},
{
find: '@alias-hq',
replacement: abs('../../src')
},
]
return { label, options, expected }
},
]