Lines Matching defs:test
99 `test timed out after ${timeout}ms`,
121 #test;
123 constructor(test) {
124 this.#test = test;
128 return this.#test.signal;
132 return this.#test.name;
136 this.#test.diagnostic(message);
140 this.#test.mock ??= new MockTracker();
141 return this.#test.mock;
145 this.#test.runOnlySubtests = !!value;
149 this.#test.skip(message);
153 this.#test.todo(message);
156 test(name, options, fn) {
162 const subtest = this.#test.createSubtest(
171 this.#test.createHook('before', fn, options);
175 this.#test.createHook('after', fn, options);
179 this.#test.createHook('beforeEach', fn, options);
183 this.#test.createHook('afterEach', fn, options);
292 skip = 'test name does not match pattern';
319 this.harness = null; // Configured on the root test by the test harness.
340 "'only' and 'runOnly' require the --test-only command-line option.";
372 const test = deferred.test;
373 this.reporter.dequeue(test.nesting, test.loc, test.name);
374 await test.run();
433 // If this test has already ended, attach this test to the root test so
442 const test = new Factory({ __proto__: null, fn, name, parent, ...options, ...overrides });
445 parent.waitingOn = test.testNumber;
449 test.startTime = test.startTime || hrtime();
450 test.fail(
452 'test could not be started because its parent finished',
458 ArrayPrototypePush(parent.subtests, test);
459 return test;
463 const error = this.outerSignal?.reason || new AbortError('The test was aborted');
475 'test did not finish before its parent and was cancelled',
479 this.startTime = this.startTime || this.endTime; // If a test was canceled before it was started, e.g inside a hook
529 // If there is enough available concurrency to run the test now, then do
530 // it. Otherwise, return a Promise to the caller and mark the test as
536 deferred.test = this;
614 // This test is using legacy Node.js error first callbacks.
630 // This test is synchronous or using Promises.
644 try { await afterEach(); } catch { /* test is already failing, let's ignore the error */ }
658 // Do not abort hooks and the root test as hooks instance are shared between tests suite so aborting them will
666 // Clean up the test. Then, try to report the results and execute any
669 // The root test is skipped here because it is a special case. Its
678 // If the test was failed before it even started, then the end time will
685 // The test has run, so recursively cancel any outstanding subtests and
686 // mark this test as failed if any subtests failed.
772 // - The current test has completed or been cancelled.
773 // - All of this test's subtests have completed or been cancelled.
774 // - It is the current test's turn to report its results.
781 // Output this test's results and update the parent's waiting counter.
867 // Report failures in the root test's after() hook.