Skip to content

Commit 1fa5334

Browse files
shvaikaleshmeeber
authored andcommitted
docs: document Error comparison rules (#42)
* Document `Error` comparison rules Closes #40
1 parent 4fba5f1 commit 1fa5334

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ The primary export of `deep-eql` is function that can be given two objects to co
9797

9898
### Rules
9999

100-
- Strict equality for non-traversable nodes according to [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
100+
- Strict equality for non-traversable nodes according to [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is):
101101
- `eql(NaN, NaN).should.be.true;`
102102
- `eql(-0, +0).should.be.false;`
103103
- All own and inherited enumerable properties are considered:
@@ -106,3 +106,6 @@ The primary export of `deep-eql` is function that can be given two objects to co
106106
- Arguments are not Arrays:
107107
- `eql([], arguments).should.be.false;`
108108
- `eql([], Array.prototype.slice.call(arguments)).should.be.true;`
109+
- Error objects are compared by reference (see https://github.com/chaijs/chai/issues/608):
110+
- `eql(new Error('msg'), new Error('msg')).should.be.false;`
111+
- `var err = new Error('msg'); eql(err, err).should.be.true;`

0 commit comments

Comments
 (0)