Skip to content

Commit 90172d6

Browse files
1 parent 3974210 commit 90172d6

25 files changed

+103
-33
lines changed

package-lock.json

+31-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"npm-run-all": "^4.1.5",
7575
"prettier": "^1.19.1",
7676
"standard-version": "^7.0.1",
77-
"webpack": "^4.41.4",
77+
"webpack": "^4.44.1",
7878
"webpack-cli": "^3.3.6",
7979
"webpack-dev-server": "^3.7.2"
8080
},

test/TestCases.test.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,23 @@ function compareDirectory(actual, expected) {
2828
describe('TestCases', () => {
2929
const casesDirectory = path.resolve(__dirname, 'cases');
3030
const outputDirectory = path.resolve(__dirname, 'js');
31+
const tests = fs.readdirSync(casesDirectory).filter((test) => {
32+
const testDirectory = path.join(casesDirectory, test);
33+
const filterPath = path.join(testDirectory, 'test.filter.js');
3134

32-
for (const directory of fs.readdirSync(casesDirectory)) {
35+
// eslint-disable-next-line global-require, import/no-dynamic-require
36+
if (fs.existsSync(filterPath) && !require(filterPath)()) {
37+
describe.skip(test, () => {
38+
it('filtered', () => {});
39+
});
40+
41+
return false;
42+
}
43+
44+
return true;
45+
});
46+
47+
for (const directory of tests) {
3348
if (!/^(\.|_)/.test(directory)) {
3449
// eslint-disable-next-line no-loop-func
3550
it(`${directory} should compile to the expected result`, (done) => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.styleA {
2+
background: red;
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.styleA {
2+
background: red;
3+
}
4+
5+
.styleB {
6+
background: blue;
7+
}
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body {
2+
background: red;
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body {
2+
background: green;
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const webpack = require('webpack');
2+
3+
module.exports = () => {
4+
return webpack.version[0] !== '4';
5+
};

test/cases/dependOn/test.filter.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const webpack = require('webpack');
2+
3+
module.exports = () => {
4+
return webpack.version[0] !== '4';
5+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.async {
2+
color: red;
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body {
2+
background: red;
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.async {
2+
color: red;
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body {
2+
background: red;
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.wX52cuPepLZcpDx5S3yYO {
2+
background: red;
3+
}
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
.wX52cuPepLZcpDx5S3yYO {
3+
background: green;
4+
}
5+

0 commit comments

Comments
 (0)