Skip to content

Commit 8e2946a

Browse files
committed
Fix tests after using cssnano
1 parent 677a416 commit 8e2946a

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"eslint": "^4.4.1",
2727
"eslint-plugin-react": "^7.1.0",
2828
"mocha": "^3.5.0",
29+
"postcss-discard-comments": "^4.0.0",
2930
"postcss-normalize-whitespace": "^4.0.0"
3031
},
3132
"scripts": {

test/fixtures/js-defined-preserve-injected.expected.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
:root {
2+
}
3+
:root {
4+
}
5+
:root {
6+
}
7+
18
.box1 {
29
width: 75px;
310
width: var(--js-defined1);

test/test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var postcss = require('postcss');
1111
var cssvariables = require('../');
1212
var cssnano = require('cssnano');
1313
var normalizeWhitespace = require('postcss-normalize-whitespace');
14+
var discardComments = require('postcss-discard-comments');
1415

1516
var MOCK_JS_VARIABLES = {
1617
'--js-defined1': '75px',
@@ -31,14 +32,14 @@ var testPlugin = function(filePath, expectedFilePath, options) {
3132
var actualResult = postcss([
3233
cssvariables(options),
3334
cssnano({
34-
preset: { plugins: [normalizeWhitespace] }
35+
preset: { plugins: [normalizeWhitespace, discardComments] }
3536
})
3637
])
3738
.process(String(actualBuffer));
3839

3940
var expectedResult = postcss([
4041
cssnano({
41-
preset: { plugins: [normalizeWhitespace] }
42+
preset: { plugins: [normalizeWhitespace, discardComments] }
4243
})
4344
])
4445
.process(String(expectedBuffer));
@@ -99,6 +100,7 @@ describe('postcss-css-variables', function() {
99100

100101

101102
test('should work with pseudo selectors', 'pseudo-selector');
103+
//test('should work with multiple pseudo selectors', 'pseudo-multi');
102104
test('should work with variables declared in pseudo selectors', 'pseudo-selector-declare-variable');
103105

104106

0 commit comments

Comments
 (0)