MCPcopy Index your code
hub / github.com/nodejs/node / assert_equals

Function assert_equals

test/fixtures/wpt/resources/testharness.js:1586–1601  ·  view source on GitHub ↗

* Assert that ``actual`` is the same value as ``expected``. * * For objects this compares by object identity; for primitives * this distinguishes between 0 and -0, and has correct handling * of NaN. * * @param {Any} actual - Test value. * @param {Any} expected - Ex

(actual, expected, description)

Source from the content-addressed store, hash-verified

1584 * @param {string} [description] - Description of the condition being tested.
1585 */
1586 function assert_equals(actual, expected, description)
1587 {
1588 /*
1589 * Test if two primitives are equal or two objects
1590 * are the same object
1591 */
1592 if (typeof actual != typeof expected) {
1593 assert(false, "assert_equals", description,
1594 "expected (" + typeof expected + ") ${expected} but got (" + typeof actual + ") ${actual}",
1595 {expected:expected, actual:actual});
1596 return;
1597 }
1598 assert(same_value(actual, expected), "assert_equals", description,
1599 "expected ${expected} but got ${actual}",
1600 {expected:expected, actual:actual});
1601 }
1602 expose_assert(assert_equals, "assert_equals");
1603
1604 /**

Callers 15

assert_toleranceFunction · 0.70
checkExpectedValuesFunction · 0.70
idlharness.jsFile · 0.70
sriharness.jsFile · 0.70
EventWatcherFunction · 0.70
assert_approx_equalsFunction · 0.70
handlerFunction · 0.50
assert_function_nameFunction · 0.50

Calls 2

assertFunction · 0.70
same_valueFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…