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

Function lazyAssertObject

lib/internal/test_runner/test.js:126–143  ·  view source on GitHub ↗
(harness)

Source from the content-addressed store, hash-verified

124}
125
126function lazyAssertObject(harness) {
127 if (assertObj === undefined) {
128 const { getAssertionMap } = require('internal/test_runner/assert');
129 const { SnapshotManager } = require('internal/test_runner/snapshot');
130
131 assertObj = getAssertionMap();
132 harness.snapshotManager = new SnapshotManager(harness.config.updateSnapshots);
133
134 if (!assertObj.has('snapshot')) {
135 assertObj.set('snapshot', harness.snapshotManager.createAssert());
136 }
137
138 if (!assertObj.has('fileSnapshot')) {
139 assertObj.set('fileSnapshot', harness.snapshotManager.createFileAssert());
140 }
141 }
142 return assertObj;
143}
144
145function stopTest(timeout, signal) {
146 const deferred = PromiseWithResolvers();

Callers 1

assertMethod · 0.85

Calls 6

getAssertionMapFunction · 0.85
createAssertMethod · 0.80
createFileAssertMethod · 0.80
hasMethod · 0.65
requireFunction · 0.50
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…