Lines Matching defs:const
2 const {
27 const { getCallerLocation } = internalBinding('util');
28 const { addAbortListener } = require('events');
29 const { AsyncResource } = require('async_hooks');
30 const { AbortController } = require('internal/abort_controller');
31 const {
38 const { MockTracker } = require('internal/test_runner/mock/mock');
39 const { TestsStream } = require('internal/test_runner/tests_stream');
40 const {
46 const {
51 const { isPromise } = require('internal/util/types');
52 const {
58 const { setTimeout } = require('timers');
59 const { TIMEOUT_MAX } = require('internal/timers');
60 const { availableParallelism } = require('os');
61 const { bigint: hrtime } = process.hrtime;
62 const kCallbackAndPromisePresent = 'callbackAndPromisePresent';
63 const kCancelledByParent = 'cancelledByParent';
64 const kAborted = 'testAborted';
65 const kParentAlreadyFinished = 'parentAlreadyFinished';
66 const kSubtestsFailed = 'subtestsFailed';
67 const kTestCodeFailure = 'testCodeFailure';
68 const kTestTimeoutFailure = 'testTimeoutFailure';
69 const kHookFailure = 'hookFailed';
70 const kDefaultTimeout = null;
71 const noop = FunctionPrototype;
72 const kShouldAbort = Symbol('kShouldAbort');
73 const kFilename = process.argv?.[1];
74 const kHookNames = ObjectSeal(['before', 'after', 'beforeEach', 'afterEach']);
75 const kUnwrapErrors = new SafeSet()
78 const { testNamePatterns, testOnlyFlag } = parseCommandLine();
82 const deferred = createDeferredPromise();
83 const abortListener = addAbortListener(signal, deferred.resolve);
157 const overrides = {
162 const subtest = this.#test.createSubtest(
212 const { concurrency, loc, only, timeout, todo, signal } = options;
243 const nesting = parent.parent === null ? parent.nesting :
339 const warning =
371 const deferred = ArrayPrototypeShift(this.pendingSubtests);
372 const test = deferred.test;
384 const start = this.waitingOn;
385 const end = start + this.readySubtests.size;
388 const subtest = this.readySubtests.get(i);
435 const preventAddingSubtests = this.finished || this.buildPhaseFinished;
442 const test = new Factory({ __proto__: null, fn, name, parent, ...options, ...overrides });
463 const error = this.outerSignal?.reason || new AbortError('The test was aborted');
487 const hook = new TestHook(fn, options);
534 const deferred = createDeferredPromise();
556 const ctx = new TestContext(this);
571 const error = new ERR_TEST_FAILURE(`failed running ${hook} hook`, kHookFailure);
588 const { args, ctx } = this.getRunArgs();
589 const after = async () => {
594 const afterEach = runOnce(async () => {
610 const runArgs = ArrayPrototypeSlice(args);
615 const { promise, cb } = createDeferredCallback();
618 const ret = ReflectApply(this.runInAsyncScope, this, runArgs);
631 const promise = ReflectApply(this.runInAsyncScope, this, runArgs);
690 const subtest = this.subtests[i];
702 const subtestString = `subtest${failed > 1 ? 's' : ''}`;
703 const msg = `${failed} ${subtestString} failed`;
729 const {
741 const coverage = harness.coverage();
800 const details = { __proto__: null, duration_ms: this.duration() };
840 const { loc, timeout, signal } = options;
865 const { error, loc, parentTest: parent } = this;
896 const { ctx, args } = this.getRunArgs();
897 const runArgs = [this.fn, ctx];
919 const ctx = new SuiteContext(this);
924 const hookArgs = this.getRunArgs();
945 const subtests = this.skipped || this.error ? [] : this.subtests;
946 const promise = SafePromiseAll(subtests, (subtests) => subtests.start());