MCPcopy Create free account
hub / github.com/nodejs/node / assert_throws_exactly_impl

Function assert_throws_exactly_impl

deps/v8/test/wasm-js/third_party/testharness.js:1795–1811  ·  view source on GitHub ↗

* Like assert_throws_exactly but allows specifying the assertion type * (assert_throws_exactly or promise_rejects_exactly, in practice).

(exception, func, description,
                                        assertion_type)

Source from the content-addressed store, hash-verified

1793 * (assert_throws_exactly or promise_rejects_exactly, in practice).
1794 */
1795 function assert_throws_exactly_impl(exception, func, description,
1796 assertion_type)
1797 {
1798 try {
1799 func.call(this);
1800 assert(false, assertion_type, description,
1801 "${func} did not throw", {func:func});
1802 } catch (e) {
1803 if (e instanceof AssertionError) {
1804 throw e;
1805 }
1806
1807 assert(same_value(e, exception), assertion_type, description,
1808 "${func} threw ${e} but we expected it to throw ${exception}",
1809 {func:func, e:e, exception:exception});
1810 }
1811 }
1812
1813 function assert_unreached(description) {
1814 assert(false, "assert_unreached", description,

Callers 2

promise_rejects_exactlyFunction · 0.70
assert_throws_exactlyFunction · 0.70

Calls 3

assertFunction · 0.70
same_valueFunction · 0.70
callMethod · 0.45

Tested by

no test coverage detected