fix browsertests

This commit is contained in:
Tobias Koppers 2017-05-25 13:12:34 +02:00
parent 5ec15f812c
commit 6368dd0368
3 changed files with 8 additions and 9 deletions

View File

@ -1,9 +1,3 @@
// Should not break it...
if(typeof require !== "function")
var require = require("amdrequire");
if(typeof define != "function")
var define = require("amdefine");
function test(cond, message) {
if(!cond) throw new Error(message);
}

View File

@ -13,5 +13,7 @@ import "./module";
export default 1234;
// exports is node.js exports and not webpacks
Object.keys(exports).should.be.eql([]);
if(eval("typeof exports !== \"undefined\"")) {
// exports is node.js exports and not webpacks
Object.keys(exports).should.be.eql([]);
}

View File

@ -5,7 +5,10 @@ it("should be able to compile a module with UMD", function() {
it("should not find a free exports", function() {
var x = require("./module2");
(x.default).should.be.equal(exports);
if(typeof exports !== "undefined")
(x.default).should.be.equal(exports);
else
(x.default).should.be.eql(false);
});
export {}