Skip to content

Commit 0ef93c7

Browse files
committed
add entry-not-found testcase
1 parent 37a518e commit 0ef93c7

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

test/ConfigTestCases.test.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ describe("ConfigTestCases", function() {
4242
});
4343
if(checkArrayExpectation(testDirectory, jsonStats, "error", "Error", done)) return;
4444
if(checkArrayExpectation(testDirectory, jsonStats, "warning", "Warning", done)) return;
45-
var exportedTest = 0;
45+
var exportedTests = 0;
4646
function _it(title, fn) {
4747
var test = new Test(title, fn);
4848
suite.addTest(test);
49-
exportedTest++;
49+
exportedTests++;
5050
return test;
5151
}
5252
function _require(module) {
@@ -58,9 +58,14 @@ describe("ConfigTestCases", function() {
5858
return module.exports;
5959
} else return require(module);
6060
}
61-
for(var i = 0; i < [].concat(options).length; i++)
62-
_require("./bundle" + i + ".js");
63-
if(exportedTest === 0) return done(new Error("No tests exported by test case"));
61+
var filesCount = 0;
62+
for(var i = 0; i < [].concat(options).length; i++) {
63+
if(fs.existsSync(path.join(outputDirectory, "bundle" + i + ".js"))) {
64+
filesCount++;
65+
_require("./bundle" + i + ".js");
66+
}
67+
}
68+
if(exportedTests < filesCount) return done(new Error("No tests exported by test case"));
6469
done();
6570
});
6671
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = [
2+
[/^Entry module not found/, /.\/index\.js/]
3+
];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {};

0 commit comments

Comments
 (0)