allow browsertesting in older browsers

This commit is contained in:
Tobias Koppers 2015-10-24 11:38:00 +02:00
parent 6307ed72ac
commit 383fd717cb
3 changed files with 20 additions and 18 deletions

View File

@ -31,6 +31,7 @@
"coveralls": "^2.11.2",
"css-loader": "~0.15.0",
"diff": "^2.0.2",
"es6-promise-polyfill": "^1.1.1",
"eslint": "^1.1.0",
"eslint-plugin-nodeca": "^1.0.3",
"express": "~4.13.1",

View File

@ -33,24 +33,6 @@ describe("main", function() {
window.library2.ok.should.be.eql(true);
});
var testCasesContext = require.context("../../cases", true, /^\.\/[^\/_]+\/[^\/_]+\/index$/);
var testCasesMap = testCasesContext.keys().map(function(key) {
return key.substring(2, key.length - "/index".length).split("/");
}).reduce(function(map, x) {
if(!map[x[0]]) map[x[0]] = [x[1]];
else map[x[0]].push(x[1]);
return map;
}, {});
Object.keys(testCasesMap).forEach(function(category) {
describe(category, function() {
testCasesMap[category].forEach(function(name) {
describe(name, function() {
testCasesContext("./" + category + "/" + name + "/index");
});
});
});
});
describe("web resolving", function() {
it("should load index.web.js instead of index.js", function() {
true.should.be.eql(true);
@ -110,6 +92,24 @@ describe("main", function() {
});
});
var testCasesContext = require.context("../../cases", true, /^\.\/[^\/_]+\/[^\/_]+\/index$/);
var testCasesMap = testCasesContext.keys().map(function(key) {
return key.substring(2, key.length - "/index".length).split("/");
}).reduce(function(map, x) {
if(!map[x[0]]) map[x[0]] = [x[1]];
else map[x[0]].push(x[1]);
return map;
}, {});
Object.keys(testCasesMap).forEach(function(category) {
describe(category, function() {
testCasesMap[category].forEach(function(name) {
describe(name, function() {
testCasesContext("./" + category + "/" + name + "/index");
});
});
});
});
});
if(module.hot) {

View File

@ -6,6 +6,7 @@
</head>
<body>
<script src="mocha.js"></script>
<script src="../../node_modules/es6-promise-polyfill/promise.js"></script>
<script>
mocha.setup('bdd');
</script>