Skip to content

Commit ccfc608

Browse files
authored
Merge pull request webpack#3555 from webpack/bugfix/filter_arrow_node_test_for_v012
fix(test): Filter ES6 features from node v0.12. Fixes webpack#3552
2 parents c3502a3 + f0fd4ec commit ccfc608

4 files changed

Lines changed: 26 additions & 2 deletions

File tree

‎test/ConfigTestCases.test.js‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* globals describe it */
12
var should = require("should");
23
var path = require("path");
34
var fs = require("fs");
@@ -17,7 +18,17 @@ describe("ConfigTestCases", function() {
1718
name: cat,
1819
tests: fs.readdirSync(path.join(casesPath, cat)).filter(function(folder) {
1920
return folder.indexOf("_") < 0;
20-
}).sort()
21+
}).sort().filter(function(testName) {
22+
var testDirectory = path.join(casesPath, cat, testName);
23+
var filterPath = path.join(testDirectory, "test.filter.js");
24+
if(fs.existsSync(filterPath) && !require(filterPath)()) {
25+
describe.skip(testName, function() {
26+
it('filtered');
27+
});
28+
return false;
29+
}
30+
return true;
31+
})
2132
};
2233
});
2334
categories.forEach(function(category) {

‎test/configCases/dll-plugin/1-use-dll/webpack.config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ module.exports = {
1111
extensions: ['.js', '.jsx']
1212
})
1313
]
14-
}
14+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var supportsArrowFn = require("../../../helpers/supportsArrowFunctionExpression");
2+
3+
module.exports = function(config) {
4+
return supportsArrowFn();
5+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = function supportArrowFunctionExpression() {
2+
try {
3+
eval("var foo = function(fn) {return fn.toString()}; foo(() => {return 'a'})");
4+
return true;
5+
} catch(e) {
6+
return false;
7+
}
8+
};

0 commit comments

Comments
 (0)