mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 20:14:37 -04:00
Publish tests.
This commit is contained in:
parent
5a8ecd593d
commit
c396800dfa
40 changed files with 21478 additions and 1 deletions
40
test/tests/unit/libs.js
Normal file
40
test/tests/unit/libs.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
describe('libs', function () {
|
||||
|
||||
var libs = {
|
||||
_: window._,
|
||||
$: window.jQuery,
|
||||
marked: window.marked,
|
||||
modernizr: window.Modernizr,
|
||||
prism: window.Prism
|
||||
};
|
||||
|
||||
_.each(libs, function (lib, id) {
|
||||
|
||||
describe('module "' + id + '"', function () {
|
||||
|
||||
it('is defined', function () {
|
||||
|
||||
assert.isDefined(modulejs._private.definitions[id]);
|
||||
});
|
||||
|
||||
it('has no instance', function () {
|
||||
|
||||
assert.notProperty(modulejs._private.instances, id);
|
||||
});
|
||||
|
||||
it('returns global lib', function () {
|
||||
|
||||
var definition = modulejs._private.definitions[id];
|
||||
var instance = definition.fn();
|
||||
assert.isDefined(instance);
|
||||
assert.strictEqual(instance, lib);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}());
|
Loading…
Add table
Add a link
Reference in a new issue