Skip to content

Commit 1f9840b

Browse files
committed
tests
1 parent daa6be5 commit 1f9840b

File tree

3 files changed

+171
-18
lines changed

3 files changed

+171
-18
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"postcss-custom-selectors": "^4.0.1",
2525
"postcss-font-family-system-ui": "^2.0.1",
2626
"postcss-font-variant": "^3.0.0",
27+
"postcss-image-set": "^1.0.0",
2728
"postcss-image-set-polyfill": "^0.3.5",
2829
"postcss-import": "^10.0.0",
2930
"postcss-media-minmax": "^3.0.0",

test/index.js

Lines changed: 149 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,155 @@ test('passes import opts correctly', (t) => {
1919
undo()
2020
})
2121

22-
test('passes cssnext opts correctly', (t) => {
23-
const undo = cssStandardsRewired.__set__('cssnext', (opts) => {
24-
t.is(opts.browsers, 'test')
25-
t.is(opts.features, 'test')
26-
t.is(opts.warnForDuplicates, 'test')
22+
test('passes customProperties opts correctly', (t) => {
23+
const undo = cssStandardsRewired.__set__('customProperties', (opts) => {
24+
t.is(opts, 'test')
25+
})
26+
cssStandardsRewired({ customProperties: 'test' })
27+
undo()
28+
})
29+
30+
test('passes calc opts correctly', (t) => {
31+
const undo = cssStandardsRewired.__set__('calc', (opts) => {
32+
t.is(opts, 'test')
33+
})
34+
cssStandardsRewired({ calc: 'test' })
35+
undo()
36+
})
37+
38+
test('passes imageSet opts correctly', (t) => {
39+
const undo = cssStandardsRewired.__set__('imageSet', (opts) => {
40+
t.is(opts, 'test')
41+
})
42+
cssStandardsRewired({ imageSet: 'test' })
43+
undo()
44+
})
45+
46+
test('passes nesting opts correctly', (t) => {
47+
const undo = cssStandardsRewired.__set__('nesting', (opts) => {
48+
t.is(opts, 'test')
49+
})
50+
cssStandardsRewired({ nesting: 'test' })
51+
undo()
52+
})
53+
54+
test('passes mediaQueriesRange opts correctly', (t) => {
55+
const undo = cssStandardsRewired.__set__('mediaQueriesRange', (opts) => {
56+
t.is(opts, 'test')
57+
})
58+
cssStandardsRewired({ mediaQueriesRange: 'test' })
59+
undo()
60+
})
61+
62+
test('passes customSelectors opts correctly', (t) => {
63+
const undo = cssStandardsRewired.__set__('customSelectors', (opts) => {
64+
t.is(opts, 'test')
65+
})
66+
cssStandardsRewired({ customSelectors: 'test' })
67+
undo()
68+
})
69+
70+
test('passes attributeCaseInsensitive opts correctly', (t) => {
71+
const undo = cssStandardsRewired.__set__('attributeCaseInsensitive', (opts) => {
72+
t.is(opts, 'test')
73+
})
74+
cssStandardsRewired({ attributeCaseInsensitive: 'test' })
75+
undo()
76+
})
77+
78+
test('passes colorRebeccapurple opts correctly', (t) => {
79+
const undo = cssStandardsRewired.__set__('colorRebeccapurple', (opts) => {
80+
t.is(opts, 'test')
81+
})
82+
cssStandardsRewired({ colorRebeccapurple: 'test' })
83+
undo()
84+
})
85+
86+
test('passes colorHwb opts correctly', (t) => {
87+
const undo = cssStandardsRewired.__set__('colorHwb', (opts) => {
88+
t.is(opts, 'test')
89+
})
90+
cssStandardsRewired({ colorHwb: 'test' })
91+
undo()
92+
})
93+
94+
test('passes colorRgb opts correctly', (t) => {
95+
const undo = cssStandardsRewired.__set__('colorRgb', (opts) => {
96+
t.is(opts, 'test')
97+
})
98+
cssStandardsRewired({ colorRgb: 'test' })
99+
undo()
100+
})
101+
102+
test('passes colorGray opts correctly', (t) => {
103+
const undo = cssStandardsRewired.__set__('colorGray', (opts) => {
104+
t.is(opts, 'test')
27105
})
28-
cssStandardsRewired({
29-
browsers: 'test',
30-
features: 'test',
31-
warnForDuplicates: 'test'
106+
cssStandardsRewired({ colorGray: 'test' })
107+
undo()
108+
})
109+
110+
test('passes colorHexAlpha opts correctly', (t) => {
111+
const undo = cssStandardsRewired.__set__('colorHexAlpha', (opts) => {
112+
t.is(opts, 'test')
113+
})
114+
cssStandardsRewired({ colorHexAlpha: 'test' })
115+
undo()
116+
})
117+
118+
test('passes colorFunction opts correctly', (t) => {
119+
const undo = cssStandardsRewired.__set__('colorFunction', (opts) => {
120+
t.is(opts, 'test')
121+
})
122+
cssStandardsRewired({ colorFunction: 'test' })
123+
undo()
124+
})
125+
126+
test('passes fontFamilySystemUi opts correctly', (t) => {
127+
const undo = cssStandardsRewired.__set__('fontFamilySystemUi', (opts) => {
128+
t.is(opts, 'test')
129+
})
130+
cssStandardsRewired({ fontFamilySystemUi: 'test' })
131+
undo()
132+
})
133+
134+
test('passes fontVariant opts correctly', (t) => {
135+
const undo = cssStandardsRewired.__set__('fontVariant', (opts) => {
136+
t.is(opts, 'test')
137+
})
138+
cssStandardsRewired({ fontVariant: 'test' })
139+
undo()
140+
})
141+
142+
test('passes pseudoClassMatches opts correctly', (t) => {
143+
const undo = cssStandardsRewired.__set__('pseudoClassMatches', (opts) => {
144+
t.is(opts, 'test')
145+
})
146+
cssStandardsRewired({ pseudoClassMatches: 'test' })
147+
undo()
148+
})
149+
150+
test('passes pseudoClassNot opts correctly', (t) => {
151+
const undo = cssStandardsRewired.__set__('pseudoClassNot', (opts) => {
152+
t.is(opts, 'test')
153+
})
154+
cssStandardsRewired({ pseudoClassNot: 'test' })
155+
undo()
156+
})
157+
158+
test('passes pseudoClassAnyLink opts correctly', (t) => {
159+
const undo = cssStandardsRewired.__set__('pseudoClassAnyLink', (opts) => {
160+
t.is(opts, 'test')
161+
})
162+
cssStandardsRewired({ pseudoClassAnyLink: 'test' })
163+
undo()
164+
})
165+
166+
test('passes autoprefixer opts correctly', (t) => {
167+
const undo = cssStandardsRewired.__set__('autoprefixer', (opts) => {
168+
t.is(opts, 'test')
32169
})
170+
cssStandardsRewired({ autoprefixer: 'test' })
33171
undo()
34172
})
35173

@@ -43,12 +181,12 @@ test('passes rucksack opts correctly', (t) => {
43181

44182
test('default plugins working', (t) => {
45183
const out = cssStandards()
46-
t.is(out.plugins.length, 3)
184+
t.is(out.plugins.length, 23)
47185
})
48186

49187
test('minify option working', (t) => {
50188
const out = cssStandards({ minify: true })
51-
t.is(out.plugins.length, 4)
189+
t.is(out.plugins.length, 24)
52190
t.is(out.plugins[out.plugins.length - 1].postcssPlugin, 'cssnano')
53191
})
54192

yarn.lock

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,11 +1320,7 @@ ecc-jsbn@~0.1.1:
13201320
dependencies:
13211321
jsbn "~0.1.0"
13221322

1323-
electron-to-chromium@^1.2.7:
1324-
version "1.3.13"
1325-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.13.tgz#1b3a5eace6e087bb5e257a100b0cbfe81b2891fc"
1326-
1327-
electron-to-chromium@^1.3.14:
1323+
electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.14:
13281324
version "1.3.14"
13291325
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.14.tgz#64af0f9efd3c3c6acd57d71f83b49ca7ee9c4b43"
13301326

@@ -1392,6 +1388,10 @@ es6-map@^0.1.3:
13921388
es6-symbol "~3.1.1"
13931389
event-emitter "~0.3.5"
13941390

1391+
es6-promise@~2.3.0:
1392+
version "2.3.0"
1393+
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-2.3.0.tgz#96edb9f2fdb01995822b263dd8aadab6748181bc"
1394+
13951395
es6-set@~0.1.5:
13961396
version "0.1.5"
13971397
resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1"
@@ -2463,7 +2463,7 @@ jest-validate@^19.0.2:
24632463
leven "^2.0.0"
24642464
pretty-format "^19.0.0"
24652465

2466-
js-base64@^2.1.9:
2466+
js-base64@^2.1.9, js-base64@~2.1.8:
24672467
version "2.1.9"
24682468
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce"
24692469

@@ -3475,6 +3475,12 @@ postcss-image-set-polyfill@^0.3.5:
34753475
postcss "^6.0.1"
34763476
postcss-media-query-parser "^0.2.3"
34773477

3478+
postcss-image-set@^1.0.0:
3479+
version "1.0.0"
3480+
resolved "https://registry.yarnpkg.com/postcss-image-set/-/postcss-image-set-1.0.0.tgz#7d28ff6292093135d5bd9e40bc593ec16b70f2db"
3481+
dependencies:
3482+
postcss "^4.1.0"
3483+
34783484
postcss-import@^10.0.0:
34793485
version "10.0.0"
34803486
resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-10.0.0.tgz#4c85c97b099136cc5ea0240dc1dfdbfde4e2ebbe"
@@ -3736,6 +3742,14 @@ postcss-zindex@^2.0.1:
37363742
postcss "^5.0.4"
37373743
uniqs "^2.0.0"
37383744

3745+
postcss@^4.1.0:
3746+
version "4.1.16"
3747+
resolved "https://registry.yarnpkg.com/postcss/-/postcss-4.1.16.tgz#4c449b4c8af9df3caf6d37f8e1e575d0361758dc"
3748+
dependencies:
3749+
es6-promise "~2.3.0"
3750+
js-base64 "~2.1.8"
3751+
source-map "~0.4.2"
3752+
37393753
postcss@^5.0, postcss@^5.0.0, postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0.14, postcss@^5.0.16, postcss@^5.0.2, postcss@^5.0.4, postcss@^5.0.5, postcss@^5.0.8, postcss@^5.2.16:
37403754
version "5.2.17"
37413755
resolved "https://registry.yarnpkg.com/postcss/-/postcss-5.2.17.tgz#cf4f597b864d65c8a492b2eabe9d706c879c388b"
@@ -4272,7 +4286,7 @@ source-map-support@^0.4.0, source-map-support@^0.4.2:
42724286
dependencies:
42734287
source-map "^0.5.6"
42744288

4275-
source-map@^0.4.4:
4289+
source-map@^0.4.4, source-map@~0.4.2:
42764290
version "0.4.4"
42774291
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b"
42784292
dependencies:

0 commit comments

Comments
 (0)