I've run into an issue which I think is a bug when using deeply equals to compare two Error objects. Even though the message of the errors is different the expectation still returns that they're equal.
Here's an example using Mocha with expect().to.eql.
it('this test should fail', () => {
const expectedError = new Error('An error');
const error = new Error('A different error');
expect(error).to.eql(expectedError);
});
Mocha passes this test even though I'd expect this to fail as the two errors have different message strings.
Is this a bug? I couldn't find any similar problems when searching the issues.
Thanks,
Marc
I've run into an issue which I think is a bug when using deeply equals to compare two
Errorobjects. Even though the message of the errors is different the expectation still returns that they're equal.Here's an example using Mocha with
expect().to.eql.Mocha passes this test even though I'd expect this to fail as the two errors have different message strings.
Is this a bug? I couldn't find any similar problems when searching the issues.
Thanks,
Marc