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

Function assertEqualsAsync

deps/v8/test/debugger/debug/es8/debug-async-break.js:7–32  ·  view source on GitHub ↗
(expected, run, msg)

Source from the content-addressed store, hash-verified

5var Debug = debug.Debug;
6
7function assertEqualsAsync(expected, run, msg) {
8 var actual;
9 var hadValue = false;
10 var hadError = false;
11 var promise = run();
12
13 if (typeof promise !== "object" || typeof promise.then !== "function") {
14 throw new MjsUnitAssertionError(
15 "Expected " + run.toString() +
16 " to return a Promise, but it returned " + promise);
17 }
18
19 promise.then(function(value) { hadValue = true; actual = value; },
20 function(error) { hadError = true; actual = error; });
21
22 assertFalse(hadValue || hadError);
23
24 %PerformMicrotaskCheckpoint();
25
26 if (hadError) throw actual;
27
28 assertTrue(
29 hadValue, "Expected '" + run.toString() + "' to produce a value");
30
31 assertEquals(expected, actual, msg);
32}
33
34var break_count = 0;
35var exception = null;

Callers 1

Calls 6

runFunction · 0.50
assertFalseFunction · 0.50
assertTrueFunction · 0.50
assertEqualsFunction · 0.50
toStringMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…