Skip to content

Commit

Permalink
Tests: Add coverage for basic "getter" behaviour in status quo
Browse files Browse the repository at this point in the history
Ref #1325.
  • Loading branch information
Krinkle committed Sep 20, 2021
1 parent 586ac24 commit 3ca66e4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/main/deepEqual.js
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,23 @@ QUnit.test( "Boolean objects", function( assert ) {
);
} );

QUnit.test( "Getter", function( assert ) {
var a = {
get x() { return 2; }
};
var a2 = {
get x() { return 2; }
};
var b = {
get x() { return 4; }
};
assert.false( QUnit.equiv( a, b ), "Getters with different values are not equivalent" );
assert.true( QUnit.equiv( a, a2 ), "Same value from different getters are equivalent" );

// Neither the presence of a descriptor nor the descriptor itself is compared
assert.true( QUnit.equiv( b, { x: 4 } ), "Getter and literal value are equivalent" );
} );

var hasES6Set = ( function() {
if ( typeof Set !== "function" ) {
return false;
Expand Down

0 comments on commit 3ca66e4

Please sign in to comment.