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

Method check

lib/internal/test_runner/test.js:223–254  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221 }
222
223 check() {
224 if (this.#planMet()) {
225 if (this.#timeoutId) {
226 clearTimeout(this.#timeoutId);
227 this.#timeoutId = null;
228 }
229 if (this.#planPromise) {
230 const { resolve } = this.#planPromise;
231 resolve();
232 this.#planPromise = null;
233 }
234 return;
235 }
236
237 if (!this.#shouldWait()) {
238 throw new ERR_TEST_FAILURE(
239 `plan expected ${this.expected} assertions but received ${this.actual}`,
240 kTestCodeFailure,
241 );
242 }
243
244 if (!this.#planPromise) {
245 const { promise, resolve, reject } = PromiseWithResolvers();
246 this.#planPromise = { __proto__: null, promise, resolve, reject };
247
248 if (!this.#waitIndefinitely) {
249 this.#timeoutId = this.#createTimeout(reject);
250 }
251 }
252
253 return this.#planPromise.promise;
254 }
255
256 count() {
257 this.actual++;

Callers 2

countMethod · 0.95
runMethod · 0.45

Calls 5

#planMetMethod · 0.95
#shouldWaitMethod · 0.95
#createTimeoutMethod · 0.95
clearTimeoutFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected