-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
type: buga defect, confirmed by a maintainera defect, confirmed by a maintainer
Description
This is regarding an issue I reported on the WebStorm tracker: https://youtrack.jetbrains.com/issue/WEB-23383
Differences between symbols that are not strictly equal, appear as being equal and are thus hard to read and confusing.
Here is a simplified version of a test where I noticed this behavior:
"use strict";
const chai = require( "chai" );
const expect = chai.expect;
chai.config.truncateThreshold = 0;
describe( "Strings", () => {
it( "should correctly display differences", () => {
expect( new String( "foo" ) ).to.equal( "foo" );
} );
} );
Because new String( "foo" )
is not equal to the primitive "foo"
, the test will correctly fail. However, in the resulting output, the difference is not immediately apparent.
In this simple test, the AssertionError
will pretty clearly identify the issue. However, in larger objects, this can be much harder to identify, especially if the truncation threshold is not raised.
Metadata
Metadata
Assignees
Labels
type: buga defect, confirmed by a maintainera defect, confirmed by a maintainer