mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 04:24:45 -04:00
Clean test code.
This commit is contained in:
parent
c8bffa006b
commit
cb5c197994
3 changed files with 6 additions and 8 deletions
|
@ -3,13 +3,13 @@
|
||||||
|
|
||||||
describe('premisses', function () {
|
describe('premisses', function () {
|
||||||
|
|
||||||
it('window is the global object', function () {
|
it('window is global object', function () {
|
||||||
|
|
||||||
assert.isObject(window);
|
assert.isObject(window);
|
||||||
assert.strictEqual(window, util.GLOBAL);
|
assert.strictEqual(window, window.window);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('jQuery is defined', function () {
|
it('jQuery and $ are global objects', function () {
|
||||||
|
|
||||||
assert.isFunction(jQuery);
|
assert.isFunction(jQuery);
|
||||||
assert.strictEqual(jQuery, window.jQuery);
|
assert.strictEqual(jQuery, window.jQuery);
|
||||||
|
@ -19,7 +19,7 @@ describe('premisses', function () {
|
||||||
assert.strictEqual($, window.$);
|
assert.strictEqual($, window.$);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('lodash is defined', function () {
|
it('_ is global object', function () {
|
||||||
|
|
||||||
assert.isFunction(_);
|
assert.isFunction(_);
|
||||||
assert.strictEqual(_, window._);
|
assert.strictEqual(_, window._);
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
window.util = window.util || {};
|
|
||||||
window.util.GLOBAL = this;
|
|
|
@ -4,14 +4,14 @@
|
||||||
function clearModulejs() {
|
function clearModulejs() {
|
||||||
|
|
||||||
_.each(modulejs._private.instances, function (val, key) {
|
_.each(modulejs._private.instances, function (val, key) {
|
||||||
|
|
||||||
delete modulejs._private.instances[key];
|
delete modulejs._private.instances[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function mockConfigModule() {
|
function mockConfigModule() {
|
||||||
|
|
||||||
modulejs.define('config', util.uniqObj());
|
modulejs.define('config', window.util.uniqObj());
|
||||||
}
|
}
|
||||||
|
|
||||||
window.util = window.util || {};
|
window.util = window.util || {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue