2012-08-02 01:12:49 +00:00
|
|
|
var chai = require('../..')
|
2014-03-18 13:35:43 +00:00
|
|
|
, expect = chai.expect
|
2012-08-02 01:12:49 +00:00
|
|
|
, should = chai.should();
|
|
|
|
|
|
|
|
var deepObj = {
|
|
|
|
green: { tea: 'matcha' }
|
|
|
|
, teas: [
|
|
|
|
'chai'
|
|
|
|
, 'matcha'
|
|
|
|
, { tea: 'konacha' }
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
var deepObj2 = {
|
|
|
|
green: { tea: 'matcha' }
|
|
|
|
, teas: [
|
|
|
|
'chai'
|
|
|
|
, 'oolong'
|
|
|
|
, { tea: 'konacha' }
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
2014-03-17 14:48:17 +00:00
|
|
|
chai.config.includeStack = true;
|
2012-12-21 20:01:15 +00:00
|
|
|
|
2012-08-02 01:12:49 +00:00
|
|
|
suite('object display', function () {
|
|
|
|
|
|
|
|
test('property', function () {
|
|
|
|
deepObj.should.have.property('chai');
|
|
|
|
});
|
|
|
|
|
|
|
|
test('deep equal', function () {
|
|
|
|
deepObj.should.deep.equal(deepObj2);
|
|
|
|
});
|
|
|
|
|
2013-02-03 18:25:55 +00:00
|
|
|
test('deep equal no diff', function () {
|
2014-03-17 14:48:17 +00:00
|
|
|
chai.config.showDiff = false;
|
2013-02-03 18:25:55 +00:00
|
|
|
deepObj.should.deep.equal(deepObj2);
|
2014-03-17 14:48:17 +00:00
|
|
|
chai.config.showDiff = true;
|
2012-12-21 20:01:15 +00:00
|
|
|
});
|
|
|
|
|
2012-08-02 01:12:49 +00:00
|
|
|
});
|
2014-03-18 13:35:43 +00:00
|
|
|
|
|
|
|
suite('undefined/null display', function() {
|
|
|
|
test('undefined for actual', function() {
|
|
|
|
expect(undefined).to.equal(null);
|
|
|
|
});
|
|
|
|
});
|