Skip to content

Commit

Permalink
test: fix (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Aug 10, 2020
1 parent 3974210 commit 90172d6
Show file tree
Hide file tree
Showing 25 changed files with 103 additions and 33 deletions.
62 changes: 31 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"standard-version": "^7.0.1",
"webpack": "^4.41.4",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2"
},
Expand Down
17 changes: 16 additions & 1 deletion test/TestCases.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,23 @@ function compareDirectory(actual, expected) {
describe('TestCases', () => {
const casesDirectory = path.resolve(__dirname, 'cases');
const outputDirectory = path.resolve(__dirname, 'js');
const tests = fs.readdirSync(casesDirectory).filter((test) => {
const testDirectory = path.join(casesDirectory, test);
const filterPath = path.join(testDirectory, 'test.filter.js');

for (const directory of fs.readdirSync(casesDirectory)) {
// eslint-disable-next-line global-require, import/no-dynamic-require
if (fs.existsSync(filterPath) && !require(filterPath)()) {
describe.skip(test, () => {
it('filtered', () => {});
});

return false;
}

return true;
});

for (const directory of tests) {
if (!/^(\.|_)/.test(directory)) {
// eslint-disable-next-line no-loop-func
it(`${directory} should compile to the expected result`, (done) => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.styleA {
background: red;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.styleA {
background: red;
}

.styleB {
background: blue;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
background: red;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
background: green;
}

5 changes: 5 additions & 0 deletions test/cases/dependOn-multiple-files-per-entry/test.filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const webpack = require('webpack');

module.exports = () => {
return webpack.version[0] !== '4';
};
5 changes: 5 additions & 0 deletions test/cases/dependOn/test.filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const webpack = require('webpack');

module.exports = () => {
return webpack.version[0] !== '4';
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.async {
color: red;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
background: red;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.async {
color: red;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
background: red;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.wX52cuPepLZcpDx5S3yYO {
background: red;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

.wX52cuPepLZcpDx5S3yYO {
background: green;
}

0 comments on commit 90172d6

Please sign in to comment.