2014-08-04 14:38:56 +08:00
|
|
|
it("should ignore require.config", function() {
|
|
|
|
require.config({
|
2017-07-07 16:27:38 +08:00
|
|
|
|
2014-08-04 14:38:56 +08:00
|
|
|
});
|
|
|
|
requirejs.config({
|
2017-07-07 16:27:38 +08:00
|
|
|
|
2014-08-04 14:38:56 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
it("should have a require.version", function() {
|
2018-01-27 06:59:38 +08:00
|
|
|
expect(require.version).toBeTypeOf("string");
|
2014-08-04 14:38:56 +08:00
|
|
|
});
|
2021-07-08 18:16:14 +08:00
|
|
|
it("should have a requirejs.onError function", function(done) {
|
2017-07-07 16:27:38 +08:00
|
|
|
function f(){}
|
2018-11-23 16:37:33 +08:00
|
|
|
expect(requirejs.onError).toBeTypeOf("undefined"); // has no default handler
|
2017-07-07 16:27:38 +08:00
|
|
|
var org = requirejs.onError;
|
|
|
|
requirejs.onError = f;
|
2018-01-27 05:51:03 +08:00
|
|
|
expect(requirejs.onError).toBe(f);
|
2017-07-07 16:27:38 +08:00
|
|
|
requirejs.onError = org;
|
2021-07-08 18:16:14 +08:00
|
|
|
require(["./file.js"], function() { done() });
|
2017-07-07 16:27:38 +08:00
|
|
|
});
|