forked from csstools/postcss-extend-rule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tape.js
82 lines (81 loc) · 2.37 KB
/
.tape.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
76
77
78
79
80
81
82
const postcss = require('postcss');
const postcssNesting = require('postcss-nesting');
const postcssExtends = require('./dist/index.cjs');
module.exports = {
'basic': {
message: 'supports @extend usage'
},
'basic:name': {
message: 'ignores @extend usage when { name: "postcss-extend" }',
options: {
name: 'postcss-extend'
},
expect: 'basic.css'
},
'basic-postcss-name': {
message: 'supports @postcss-extend when { name: "postcss-extend" }',
options: {
name: 'postcss-extend'
},
expect: 'basic.expect.css'
},
'basic.button': {
message: 'supports @extend usage with same tag name and class name',
expect: 'basic.button.expect.css'
},
'advanced': {
message: 'supports mixed usage (with postcss-nesting)',
plugin: postcss(postcssNesting, postcssExtends)
},
'nested-media': {
'message': 'supports nested @media usage'
},
'nested-media:nesting-first': {
'message': 'supports nested @media usage when postcss-nesting runs first',
plugin: postcss(postcssNesting, postcssExtends)
},
'nested-media:nesting-second': {
'message': 'supports nested @media usage when postcss-nesting runs second',
plugin: postcss(postcssExtends, postcssNesting)
},
'error': {
message: 'manages error-ridden usage'
},
'error:ignore': {
message: 'manages error-ridden usage with { onFunctionalSelector: "ignore", onRecursiveExtend: "ignore", onUnusedExtend: "ignore" } options',
options: {
onFunctionalSelector: 'ignore',
onRecursiveExtend: 'ignore',
onUnusedExtend: 'ignore'
}
},
'error:warn': {
message: 'manages error-ridden usage with { onFunctionalSelector: "warn", onRecursiveExtend: "warn", onUnusedExtend: "warn" } options',
options: {
onFunctionalSelector: 'warn',
onRecursiveExtend: 'warn',
onUnusedExtend: 'warn'
},
warnings: 2
},
'error:throw': {
message: 'manages error-ridden usage with { onFunctionalSelector: "throw", onRecursiveExtend: "throw", onUnusedExtend: "throw" } options',
options: {
onFunctionalSelector: 'throw',
onRecursiveExtend: 'throw',
onUnusedExtend: 'throw'
},
error: {
reason: 'Unused extend at-rule "some-non-existent-selector"'
}
},
'error:throw-on-functional-selectors': {
message: 'manages error-ridden usage with { onFunctionalSelector: "throw" } options',
options: {
onFunctionalSelector: 'throw'
},
error: {
reason: 'Encountered functional selector "%test-placeholder"'
}
}
};