61 lines
1.3 KiB
JavaScript
61 lines
1.3 KiB
JavaScript
(function () {
|
|
'use strict';
|
|
|
|
var ID = 'config';
|
|
var DEPS = [];
|
|
|
|
describe('module "' + ID + '"', function () {
|
|
|
|
before(function () {
|
|
|
|
this.definition = modulejs._private.definitions[ID];
|
|
|
|
this.applyFn = function () {
|
|
|
|
return this.definition.fn($);
|
|
};
|
|
});
|
|
|
|
describe('definition', function () {
|
|
|
|
it('is defined', function () {
|
|
|
|
assert.isPlainObject(this.definition);
|
|
});
|
|
|
|
it('has correct id', function () {
|
|
|
|
assert.strictEqual(this.definition.id, ID);
|
|
});
|
|
|
|
it('requires correct', function () {
|
|
|
|
assert.deepEqual(this.definition.deps, DEPS);
|
|
});
|
|
|
|
it('args for each request', function () {
|
|
|
|
assert.strictEqual(this.definition.deps.length, this.definition.fn.length);
|
|
});
|
|
|
|
it('has no instance', function () {
|
|
|
|
assert.notProperty(modulejs._private.instances, ID);
|
|
});
|
|
|
|
it('inits without errors', function () {
|
|
|
|
this.applyFn();
|
|
});
|
|
|
|
it('is only dummy definition', function () {
|
|
|
|
var instance = this.applyFn();
|
|
assert.isPlainObject(instance);
|
|
assert.lengthOfKeys(instance, 1);
|
|
assert.isTrue(util.isUniqId(instance.uniqId));
|
|
});
|
|
});
|
|
});
|
|
|
|
}());
|