Skip to content

Commit

Permalink
Restructure the bundle false test
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Nov 5, 2018
1 parent 444cb85 commit fa1ad6f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/helpers.js
Expand Up @@ -12,7 +12,7 @@ exports.find = function(browser, property, callback, done){
} else if(new Date() - start < 2000){
setTimeout(check, 20);
} else {
done("failed to find "+property+" in "+browser.window.location.href);
done(new Error("failed to find "+property+" in "+browser.window.location.href));
}
};
check();
Expand Down
19 changes: 14 additions & 5 deletions test/multibuild_test.js
Expand Up @@ -1507,6 +1507,7 @@ describe("multi build", function(){


it("should not include src/dep and jqueryt into the bundled file", function(done){
this.timeout(15000);
setup(function(error) {
if (error) {
return done(error);
Expand All @@ -1529,22 +1530,30 @@ describe("multi build", function(){
assert.equal(data.loader.envs['window-production'].map.jqueryt, '@empty', 'ignore modules must declare as @empty');

open("test/bundle_false/prod.html",function(browser, close){
var complete = 0;
var findDone = function() {
complete++;
if(complete === 2) {
close();
}
};

find(browser,"MODULE", function(module){
//assert.ok(module);
assert.equal(typeof module.name, "undefined", "depending Module shouldn't have been loaded");
}, close);
findDone();
}, findDone);

find(browser,"$", function(jqueryt){
// jqueryt is mapped to @empty
assert.ok(jqueryt);
var jversion = false;
try{
jversion = jqueryt.fn.version;
}catch(e){}
} catch(e) {}

assert.strictEqual(jversion, false, "jqueryt Module shouldn't have been loaded");
close();
}, close);
findDone();
}, findDone);

}, done);
}).catch(done);
Expand Down

0 comments on commit fa1ad6f

Please sign in to comment.