chicago
Version:
A front-end JavaScript library for user-interface developers.
87 lines (65 loc) • 1.76 kB
JavaScript
describe('Chicago.extensions', function() {
describe('#Object', function() {
describe('#it', function() {
var obj1 = {
a : 1,
b : 2,
};
var obj2 = {
a : 1,
b : 2,
};
it('Has method `it`', function() {
( typeof Object.is === 'function' ).should.be.true;
});
it('Object.is returns true', function() {
Object.is(obj1, obj1).should.be.true;
});
it('Object.is returns false', function() {
Object.is(obj1, obj2).should.be.false;
});
});
});
describe('#Array', function() {
var array = [ 0, 1, 2, 3 ];
describe('#last', function() {
it('Has method `last`', function() {
( typeof Array.prototype.last === 'function' ).should.be.true;
});
it('Returns true', function() {
array.last().should.equal( 3 );
});
it('Returns false', function() {
array.last().should.not.equal( 0 );
array.last().should.not.equal( 1 );
array.last().should.not.equal( 2 );
});
});
describe('#max', function() {
it('Has method `max`', function() {
( typeof Array.prototype.max === 'function' ).should.be.true;
});
it('Returns true', function() {
array.max().should.equal( 3 );
});
it('Returns false', function() {
array.max().should.not.equal( 0 );
array.max().should.not.equal( 1 );
array.max().should.not.equal( 2 );
});
});
describe('#min', function() {
it('Has method `min`', function() {
( typeof Array.prototype.min === 'function' ).should.be.true;
});
it('Returns true', function() {
array.min().should.equal( 0 );
});
it('Returns false', function() {
array.min().should.not.equal( 1 );
array.min().should.not.equal( 2 );
array.min().should.not.equal( 3 );
});
});
});
});