chicago
Version:
A front-end JavaScript library for user-interface developers.
103 lines (77 loc) • 2.33 kB
JavaScript
describe('Chicago.core', function() {
var _c,
should,
globals = {
version : '1.0.0beta'
};
if( typeof require === 'function' ) {
require('mocha-jsdom')();
var should = require('should');
}
before(function() {
if( typeof require !== 'undefined' ) {
global.window.jQuery = require('jquery');
_c = require('../../../dist/Chicago.js');
} else {
_c = window.Chicago;
}
});
describe('#properties', function() {
it('Property `version` exists', function() {
_c.should.have.property( 'version' );
});
it('Version is correct (' + globals.version + ')', function() {
_c.version.should.equal( globals.version );
});
it('Property `$` exists', function() {
_c.should.have.property( '$' );
});
it('Property `$doc` exists', function() {
_c.should.have.property( '$doc' );
});
it('Property `$win` exists', function() {
_c.should.have.property( '$win' );
});
it('Property `$html` exists', function() {
_c.should.have.property( '$html' );
});
it('Property `$body` exists', function() {
_c.should.have.property( '$body' );
});
it('Property `utils` exists', function() {
_c.should.have.property( 'utils' );
});
it('Property `support` exists', function() {
_c.should.have.property( 'support' );
});
it('Property `modules` exists', function() {
_c.should.have.property( 'modules' );
});
});
describe('#methods', function() {
it('Method `noConflict` exists', function() {
(typeof _c.noConflict === 'undefined').should.not.be.true;
});
it('Method `noConflict` is function', function() {
(typeof _c.noConflict === 'function').should.be.true;
});
it('Method `noConflict` returns object', function() {
var obj = _c.noConflict();
(typeof obj === 'undefined').should.not.be.true;
(typeof obj === 'object').should.be.true;
});
it('Method `fn` exists', function() {
(typeof _c.fn === 'undefined').should.not.be.true;
});
it('Method `fn` is function', function() {
(typeof _c.fn === 'function').should.be.true;
});
it('Method `module` exists', function() {
(typeof _c.module === 'undefined').should.not.be.true;
});
it('Method `module` binds method to global object', function() {
_c.module('test', {});
(typeof _c.test === 'undefined').should.not.be.true;
});
});
});