Skip to content

Commit

Permalink
deepFunction. Closes #140. Closes #141
Browse files Browse the repository at this point in the history
  • Loading branch information
hueniverse committed Jul 24, 2019
1 parent 7dccabe commit 91802a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ internals.addMethod('length', internals.length);
internals.equal = function (value, options) {

options = options || {};
const settings = Hoek.applyToDefaults({ prototype: exports.settings.comparePrototypes }, options);
const settings = Hoek.applyToDefaults({ prototype: exports.settings.comparePrototypes, deepFunction: true }, options);

const compare = this._flags.shallow ? (a, b) => a === b
: (a, b) => Hoek.deepEqual(a, b, settings);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"assertion"
],
"dependencies": {
"@hapi/hoek": "6.x.x"
"@hapi/hoek": "8.x.x"
},
"devDependencies": {
"@hapi/lab": "18.x.x"
"@hapi/lab": "19.x.x"
},
"scripts": {
"test": "lab -t 100 -L",
Expand Down
5 changes: 5 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,11 @@ describe('expect()', () => {
Code.expect(Object.create(null)).to.not.equal({}, { prototype: true });
Code.expect(Object.create(null)).to.equal({}, { prototype: false });
Code.expect(Object.create(null)).to.equal({});
Code.expect({ a: 1, b: 2 }).to.equal({ a: 1, b: 3 }, { skip: ['b'] });

const f1 = () => { };
const f1a = () => { };
Code.expect({ f1 }).to.equal({ f1: f1a });
}
catch (err) {
var exception = err;
Expand Down

0 comments on commit 91802a7

Please sign in to comment.