Skip to content

Commit 9218b4c

Browse files
committed
fixed tests
1 parent 46a918f commit 9218b4c

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

test/Examples.test.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,23 @@ describe("Examples", function() {
1717
webpackConfigPath = webpackConfigPath.substr(0, 1).toUpperCase() + webpackConfigPath.substr(1);
1818
if(fs.existsSync(webpackConfigPath))
1919
options = require(webpackConfigPath);
20-
options.context = examplePath;
21-
options.optimize = options.optimize || {};
22-
options.output = options.output || {};
23-
options.optimize.occurenceOrder = true;
24-
options.output.pathInfo = true;
25-
options.output.path = path.join(examplePath, "js");
26-
options.output.publicPath = "js/";
27-
if(!options.output.filename)
28-
options.output.filename = "output.js";
29-
if(!options.entry)
30-
options.entry = "./example.js";
20+
if(Array.isArray(options))
21+
options.forEach(processOptions);
22+
else
23+
processOptions(options);
24+
function processOptions(options) {
25+
options.context = examplePath;
26+
options.optimize = options.optimize || {};
27+
options.output = options.output || {};
28+
options.optimize.occurenceOrder = true;
29+
options.output.pathInfo = true;
30+
options.output.path = path.join(examplePath, "js");
31+
options.output.publicPath = "js/";
32+
if(!options.output.filename)
33+
options.output.filename = "output.js";
34+
if(!options.entry)
35+
options.entry = "./example.js";
36+
}
3137
webpack(options, function(err, stats) {
3238
if(err) return done(err);
3339
stats = stats.toJson();

0 commit comments

Comments
 (0)