-
-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy path.tape.mjs
58 lines (57 loc) · 1.17 KB
/
.tape.mjs
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
import { postcssTape, ruleClonerPlugin } from '@csstools/postcss-tape';
import plugin from 'postcss-image-set-function';
postcssTape(plugin)({
'basic': {
message: 'supports basic usage',
},
'basic:no-preserve': {
message: 'supports { preserve: false } usage',
options: {
preserve: false
}
},
'basic:with-cloned-rules': {
message: 'doesn\'t cause duplicate CSS',
plugins: [
ruleClonerPlugin,
plugin({
preserve: true
})
]
},
'invalid': {
message: 'ignores invalid usage',
expect: 'invalid.css',
result: 'invalid.css'
},
'invalid:warn': {
message: 'warns invalid usage when { onvalid: "warn" }',
options: {
onInvalid: 'warn'
},
expect: 'invalid.css',
result: 'invalid.css',
warnings: 9
},
'invalid:throw': {
message: 'throws invalid usage when { onvalid: "throw" }',
options: {
onInvalid: 'throw'
},
expect: 'invalid.css',
result: 'invalid.css',
exception: /unexpected image/
},
'generated-value-cases': {
message: 'correctly handles generated cases',
options: {
preserve: false
}
},
'generated-value-cases:preserve': {
message: 'correctly handles generated cases',
options: {
preserve: true
}
},
});