mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 20:14:37 -04:00
Add scar tests.
This commit is contained in:
parent
1cba9290b6
commit
c4fa90a747
12 changed files with 263 additions and 3 deletions
33
test-scar/tests/unit/modulejs.js
Normal file
33
test-scar/tests/unit/modulejs.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
const {test, assert} = require('scar');
|
||||
|
||||
test('modulejs is global object', () => {
|
||||
assert.equal(typeof window.modulejs, 'object');
|
||||
});
|
||||
|
||||
test('modulejs.define() is function', () => {
|
||||
assert.equal(typeof window.modulejs.define, 'function');
|
||||
});
|
||||
|
||||
test('modulejs.require() is function', () => {
|
||||
assert.equal(typeof window.modulejs.require, 'function');
|
||||
});
|
||||
|
||||
test('modulejs.state() is function', () => {
|
||||
assert.equal(typeof window.modulejs.state, 'function');
|
||||
});
|
||||
|
||||
test('modulejs.log() is function', () => {
|
||||
assert.equal(typeof window.modulejs.log, 'function');
|
||||
});
|
||||
|
||||
test('modulejs._private is object', () => {
|
||||
assert.equal(typeof window.modulejs._private, 'object');
|
||||
});
|
||||
|
||||
test('modulejs has definitions', () => {
|
||||
assert.ok(Object.keys(window.modulejs._private.definitions).length >= 0);
|
||||
});
|
||||
|
||||
test('modulejs has no instances', () => {
|
||||
assert.equal(Object.keys(window.modulejs._private.instances).length, 0);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue