2012-11-05 17:38:57 +01:00
|
|
|
// Single File library
|
|
|
|
var loadTimelibrary1 = typeof window.library1 === "undefined"
|
|
|
|
describe("library1", function() {
|
|
|
|
it("should load library1 only once", function() {
|
|
|
|
loadTimelibrary1.should.be.ok;
|
2012-10-28 22:44:32 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should load a component", function() {
|
|
|
|
require("./lib/component").should.be.eql("lib1 component");
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should load async submodules with require.ensure even if single == true", function(done) {
|
|
|
|
var sameTick = true;
|
|
|
|
require.ensure(["submodule1", "submodule2"], function(require) {
|
|
|
|
sameTick.should.be.eql(true);
|
|
|
|
require("submodule1").should.be.eql("submodule1");
|
|
|
|
require("submodule2").should.be.eql("submodule2");
|
|
|
|
require("submodule3")().should.be.eql("submodule3");
|
|
|
|
require.ensure([], function(require) {
|
|
|
|
sameTick.should.be.eql(true);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
sameTick = false;
|
2012-03-10 13:11:23 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
module.exports = true;
|