id
int64
0
3.78k
code
stringlengths
13
37.9k
declarations
stringlengths
16
64.6k
1,800
send( request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage, ): void
type ChildMessage = | ChildMessageInitialize | ChildMessageCall | ChildMessageEnd | ChildMessageMemUsage;
1,801
(listener: OnCustomMessage) => () => void
type OnCustomMessage = (message: Array<unknown> | unknown) => void;
1,802
enqueue(task: QueueChildMessage, workerId?: number): void
type QueueChildMessage = { request: ChildMessageCall; onStart: OnStart; onEnd: OnEnd; onCustomMessage: OnCustomMessage; };
1,803
(worker: WorkerInterface) => void
interface WorkerInterface { get state(): WorkerStates; send( request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage, ): void; waitForExit(): Promise<void>; forceExit(): void; getWorkerId(): number; getStderr(): NodeJS.ReadableStream | null;...
1,804
(listener: OnCustomMessage) => { customMessageListeners.add(listener); return () => { customMessageListeners.delete(listener); }; }
type OnCustomMessage = (message: Array<unknown> | unknown) => void;
1,805
(worker: WorkerInterface) => { if (hash != null) { this._cacheKeys[hash] = worker; } }
interface WorkerInterface { get state(): WorkerStates; send( request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage, ): void; waitForExit(): Promise<void>; forceExit(): void; getWorkerId(): number; getStderr(): NodeJS.ReadableStream | null;...
1,806
private _push(task: QueueChildMessage): Farm { this._taskQueue.enqueue(task); const offset = this._getNextWorkerOffset(); for (let i = 0; i < this._numOfWorkers; i++) { this._process((offset + i) % this._numOfWorkers); if (task.request[1]) { break; } } return this; }
type QueueChildMessage = { request: ChildMessageCall; onStart: OnStart; onEnd: OnEnd; onCustomMessage: OnCustomMessage; };
1,807
constructor(private readonly _computePriority: ComputeTaskPriorityCallback) {}
type ComputeTaskPriorityCallback = ( method: string, ...args: Array<unknown> ) => number;
1,808
enqueue(task: QueueChildMessage, workerId?: number): void { if (workerId == null) { this._enqueue(task, this._sharedQueue); } else { const queue = this._getWorkerQueue(workerId); this._enqueue(task, queue); } }
type QueueChildMessage = { request: ChildMessageCall; onStart: OnStart; onEnd: OnEnd; onCustomMessage: OnCustomMessage; };
1,809
_enqueue(task: QueueChildMessage, queue: MinHeap<QueueItem>): void { const item = { priority: this._computePriority(task.request[2], ...task.request[3]), task, }; queue.add(item); }
type QueueChildMessage = { request: ChildMessageCall; onStart: OnStart; onEnd: OnEnd; onCustomMessage: OnCustomMessage; };
1,810
enqueue(task: QueueChildMessage, workerId?: number): void { if (workerId == null) { this._sharedQueue.enqueue(task); return; } let workerQueue = this._workerQueues[workerId]; if (workerQueue == null) { workerQueue = this._workerQueues[workerId] = new InternalQueue<WorkerQueueV...
type QueueChildMessage = { request: ChildMessageCall; onStart: OnStart; onEnd: OnEnd; onCustomMessage: OnCustomMessage; };
1,811
override createWorker(workerOptions: WorkerOptions): WorkerInterface { let Worker; if (this._options.enableWorkerThreads) { Worker = require('./workers/NodeThreadsWorker').default; } else { Worker = require('./workers/ChildProcessWorker').default; } return new Worker(workerOptions); }
type WorkerOptions = { forkOptions: ForkOptions; resourceLimits: ResourceLimits; setupArgs: Array<unknown>; maxRetries: number; workerId: number; workerData?: unknown; workerPath: string; /** * After a job has executed the memory usage it should return to. * * @remarks * Note this is differe...
1,812
createWorker(_workerOptions: WorkerOptions): WorkerInterface { throw Error('Missing method createWorker in WorkerPool'); }
type WorkerOptions = { forkOptions: ForkOptions; resourceLimits: ResourceLimits; setupArgs: Array<unknown>; maxRetries: number; workerId: number; workerData?: unknown; workerPath: string; /** * After a job has executed the memory usage it should return to. * * @remarks * Note this is differe...
1,813
(workerOptions: WorkerOptions) => WorkerInterface
type WorkerOptions = { forkOptions: ForkOptions; resourceLimits: ResourceLimits; setupArgs: Array<unknown>; maxRetries: number; workerId: number; workerData?: unknown; workerPath: string; /** * After a job has executed the memory usage it should return to. * * @remarks * Note this is differe...
1,814
override createWorker(workerOptions: WorkerOptions) { return new Worker(workerOptions); }
type WorkerOptions = { forkOptions: ForkOptions; resourceLimits: ResourceLimits; setupArgs: Array<unknown>; maxRetries: number; workerId: number; workerData?: unknown; workerPath: string; /** * After a job has executed the memory usage it should return to. * * @remarks * Note this is differe...
1,815
constructor(options: WorkerOptions) { super(options); this._options = options; this._request = null; this._stdout = null; this._stderr = null; this._childIdleMemoryUsage = null; this._childIdleMemoryUsageLimit = options.idleMemoryLimit || null; this._childWorkerPath = options.c...
type WorkerOptions = { forkOptions: ForkOptions; resourceLimits: ResourceLimits; setupArgs: Array<unknown>; maxRetries: number; workerId: number; workerData?: unknown; workerPath: string; /** * After a job has executed the memory usage it should return to. * * @remarks * Note this is differe...
1,816
private _onMessage(response: ParentMessage) { // Ignore messages not intended for us if (!Array.isArray(response)) return; // TODO: Add appropriate type check let error: any; switch (response[0]) { case PARENT_MESSAGE_OK: this._onProcessEnd(null, response[1]); break; c...
type ParentMessage = | ParentMessageOk | ParentMessageError | ParentMessageCustom | ParentMessageMemUsage;
1,817
send( request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage, ): void { this._stderrBuffer = []; onProcessStart(this); this._onProcessEnd = (...args) => { const hasRequest = !!this._request; // Clean the request to avoid sending...
type OnStart = (worker: WorkerInterface) => void;
1,818
send( request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage, ): void { this._stderrBuffer = []; onProcessStart(this); this._onProcessEnd = (...args) => { const hasRequest = !!this._request; // Clean the request to avoid sending...
type OnCustomMessage = (message: Array<unknown> | unknown) => void;
1,819
send( request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage, ): void { this._stderrBuffer = []; onProcessStart(this); this._onProcessEnd = (...args) => { const hasRequest = !!this._request; // Clean the request to avoid sending...
type OnEnd = (err: Error | null, result: unknown) => void;
1,820
send( request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage, ): void { this._stderrBuffer = []; onProcessStart(this); this._onProcessEnd = (...args) => { const hasRequest = !!this._request; // Clean the request to avoid sending...
type ChildMessage = | ChildMessageInitialize | ChildMessageCall | ChildMessageEnd | ChildMessageMemUsage;
1,821
function reportError(error: Error, type: PARENT_MESSAGE_ERROR) { if (isMainThread) { throw new Error('Child can only be used on a forked process'); } if (error == null) { error = new Error('"null" or "undefined" thrown'); } parentPort!.postMessage([ type, error.constructor && error.construct...
type PARENT_MESSAGE_ERROR = | typeof PARENT_MESSAGE_CLIENT_ERROR | typeof PARENT_MESSAGE_SETUP_ERROR;
1,822
function execFunction( fn: UnknownFunction, ctx: unknown, args: Array<unknown>, onResult: (result: unknown) => void, onError: (error: Error) => void, ): void { let result: unknown; try { result = fn.apply(ctx, args); } catch (err: any) { onError(err); return; } if (isPromise(result)) ...
type UnknownFunction = (...args: Array<unknown>) => unknown;
1,823
function execFunction( fn: UnknownFunction, ctx: unknown, args: Array<unknown>, onResult: (result: unknown) => void, onError: (error: Error) => void, ): void { let result: unknown; try { result = fn.apply(ctx, args); } catch (err: any) { onError(err); return; } if (isPromise(result)) ...
type UnknownFunction = (...args: Array<unknown>) => unknown | Promise<unknown>;
1,824
function execFunction( fn: UnknownFunction, ctx: unknown, args: Array<unknown>, onResult: (result: unknown) => void, onError: (error: Error) => void, ): void { let result: unknown; try { result = fn.apply(ctx, args); } catch (err: any) { onError(err); return; } if (isPromise(result)) ...
type UnknownFunction = (...args: Array<unknown>) => unknown | Promise<unknown>;
1,825
constructor(options: WorkerOptions) { super(); if (typeof options.on === 'object') { for (const [event, handlers] of Object.entries(options.on)) { // Can't do Array.isArray on a ReadonlyArray<T>. // https://github.com/microsoft/TypeScript/issues/17002 if (typeof handlers === 'func...
type WorkerOptions = { forkOptions: ForkOptions; resourceLimits: ResourceLimits; setupArgs: Array<unknown>; maxRetries: number; workerId: number; workerData?: unknown; workerPath: string; /** * After a job has executed the memory usage it should return to. * * @remarks * Note this is differe...
1,826
function reportError(error: Error, type: PARENT_MESSAGE_ERROR) { if (!process || !process.send) { throw new Error('Child can only be used on a forked process'); } if (error == null) { error = new Error('"null" or "undefined" thrown'); } process.send([ type, error.constructor && error.constru...
type PARENT_MESSAGE_ERROR = | typeof PARENT_MESSAGE_CLIENT_ERROR | typeof PARENT_MESSAGE_SETUP_ERROR;
1,827
constructor(options: WorkerOptions) { super(options); this._options = options; this._request = null; this._stdout = null; this._stderr = null; this._childWorkerPath = options.childWorkerPath || require.resolve('./threadChild'); this._childIdleMemoryUsage = null; this._childIdl...
type WorkerOptions = { forkOptions: ForkOptions; resourceLimits: ResourceLimits; setupArgs: Array<unknown>; maxRetries: number; workerId: number; workerData?: unknown; workerPath: string; /** * After a job has executed the memory usage it should return to. * * @remarks * Note this is differe...
1,828
private _onMessage(response: ParentMessage) { // Ignore messages not intended for us if (!Array.isArray(response)) return; let error; switch (response[0]) { case PARENT_MESSAGE_OK: this._onProcessEnd(null, response[1]); break; case PARENT_MESSAGE_CLIENT_ERROR: erro...
type ParentMessage = | ParentMessageOk | ParentMessageError | ParentMessageCustom | ParentMessageMemUsage;
1,829
send( request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd | null, onCustomMessage: OnCustomMessage, ): void { onProcessStart(this); this._onProcessEnd = (...args) => { const hasRequest = !!this._request; // Clean the request to avoid sending past requests to worker...
type OnStart = (worker: WorkerInterface) => void;
1,830
send( request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd | null, onCustomMessage: OnCustomMessage, ): void { onProcessStart(this); this._onProcessEnd = (...args) => { const hasRequest = !!this._request; // Clean the request to avoid sending past requests to worker...
type OnCustomMessage = (message: Array<unknown> | unknown) => void;
1,831
send( request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd | null, onCustomMessage: OnCustomMessage, ): void { onProcessStart(this); this._onProcessEnd = (...args) => { const hasRequest = !!this._request; // Clean the request to avoid sending past requests to worker...
type ChildMessage = | ChildMessageInitialize | ChildMessageCall | ChildMessageEnd | ChildMessageMemUsage;
1,832
constructor(moduleMap: IModuleMap, options: ResolverConfig) { this._options = { defaultPlatform: options.defaultPlatform, extensions: options.extensions, hasCoreModules: options.hasCoreModules === undefined ? true : options.hasCoreModules, moduleDirectories: options.moduleDirectories...
interface IModuleMap<S = SerializableModuleMap> { getModule( name: string, platform?: string | null, supportsNativePlatform?: boolean | null, type?: HTypeValue | null, ): string | null; getPackage( name: string, platform: string | null | undefined, _supportsNativePlatform: boolean | n...
1,833
constructor(moduleMap: IModuleMap, options: ResolverConfig) { this._options = { defaultPlatform: options.defaultPlatform, extensions: options.extensions, hasCoreModules: options.hasCoreModules === undefined ? true : options.hasCoreModules, moduleDirectories: options.moduleDirectories...
type ResolverConfig = { defaultPlatform?: string | null; extensions: Array<string>; hasCoreModules: boolean; moduleDirectories: Array<string>; moduleNameMapper?: Array<ModuleNameMapperConfig> | null; modulePaths?: Array<string>; platforms?: Array<string>; resolver?: string | null; rootDir: string; };
1,834
public static duckType(error: ModuleNotFoundError): ModuleNotFoundError { error.buildMessage = ModuleNotFoundError.prototype.buildMessage; return error; }
class ModuleNotFoundError extends Error { public code = 'MODULE_NOT_FOUND'; public hint?: string; public requireStack?: Array<string>; public siblingWithSimilarExtensionFound?: boolean; public moduleName?: string; private _originalMessage?: string; constructor(message: string, moduleName?: string) { ...
1,835
( pkg: PackageJSON, file: string, dir: string, ) => PackageJSON
type PackageJSON = JSONObject;
1,836
( pkg: PackageJSON, path: string, relativePath: string, ) => string
type PackageJSON = JSONObject;
1,837
(pkg: PackageJSON, file: string, dir: string) => pkg
type PackageJSON = JSONObject;
1,838
(pkg: PackageJSON, path: string, relativePath: string) => relativePath
type PackageJSON = JSONObject;
1,839
function getFormatOptions( formatOptions: PrettyFormatOptions, options?: DiffOptions, ): PrettyFormatOptions { const {compareKeys} = normalizeDiffOptions(options); return { ...formatOptions, compareKeys, }; }
type DiffOptions = { aAnnotation?: string; aColor?: DiffOptionsColor; aIndicator?: string; bAnnotation?: string; bColor?: DiffOptionsColor; bIndicator?: string; changeColor?: DiffOptionsColor; changeLineTrailingSpaceColor?: DiffOptionsColor; commonColor?: DiffOptionsColor; commonIndicator?: string; ...
1,840
function getFormatOptions( formatOptions: PrettyFormatOptions, options?: DiffOptions, ): PrettyFormatOptions { const {compareKeys} = normalizeDiffOptions(options); return { ...formatOptions, compareKeys, }; }
type DiffOptions = ImportDiffOptions;
1,841
function getFormatOptions( formatOptions: PrettyFormatOptions, options?: DiffOptions, ): PrettyFormatOptions { const {compareKeys} = normalizeDiffOptions(options); return { ...formatOptions, compareKeys, }; }
interface PrettyFormatOptions extends Omit<SnapshotFormat, 'compareKeys'> { compareKeys?: CompareKeys; plugins?: Plugins; }
1,842
( { aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator, includeChangeCounts, omitAnnotationLines, }: DiffOptionsNormalized, changeCounts: ChangeCounts, ): string => { if (omitAnnotationLines) { return ''; } let aRest = ''; let bRest = ''; if (includeCh...
type DiffOptionsNormalized = { aAnnotation: string; aColor: DiffOptionsColor; aIndicator: string; bAnnotation: string; bColor: DiffOptionsColor; bIndicator: string; changeColor: DiffOptionsColor; changeLineTrailingSpaceColor: DiffOptionsColor; commonColor: DiffOptionsColor; commonIndicator: string; ...
1,843
( { aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator, includeChangeCounts, omitAnnotationLines, }: DiffOptionsNormalized, changeCounts: ChangeCounts, ): string => { if (omitAnnotationLines) { return ''; } let aRest = ''; let bRest = ''; if (includeCh...
type ChangeCounts = { a: number; b: number; };
1,844
(diff: Diff) => { switch (diff[0]) { case DIFF_DELETE: diff[1] = aLinesDisplay[aIndex]; aIndex += 1; break; case DIFF_INSERT: diff[1] = bLinesDisplay[bIndex]; bIndex += 1; break; default: diff[1] = bLinesDisplay[bIndex]; aIndex += 1...
class Diff { 0: number; 1: string; constructor(op: number, text: string) { this[0] = op; this[1] = text; } }
1,845
(diff: Diff, i: number, diffs: Array<Diff>): string => { const line = diff[1]; const isFirstOrLast = i === 0 || i === diffs.length - 1; switch (diff[0]) { case DIFF_DELETE: return printDeleteLine(line, isFirstOrLast, options); case DIFF_INSERT: return printInsertL...
class Diff { 0: number; 1: string; constructor(op: number, text: string) { this[0] = op; this[1] = text; } }
1,846
(compareKeys?: CompareKeys): CompareKeys => compareKeys && typeof compareKeys === 'function' ? compareKeys : OPTIONS_DEFAULT.compareKeys
type CompareKeys = ((a: string, b: string) => number) | null | undefined;
1,847
( options: DiffOptions = {}, ): DiffOptionsNormalized => ({ ...OPTIONS_DEFAULT, ...options, compareKeys: getCompareKeys(options.compareKeys), contextLines: getContextLines(options.contextLines), })
type DiffOptions = { aAnnotation?: string; aColor?: DiffOptionsColor; aIndicator?: string; bAnnotation?: string; bColor?: DiffOptionsColor; bIndicator?: string; changeColor?: DiffOptionsColor; changeLineTrailingSpaceColor?: DiffOptionsColor; commonColor?: DiffOptionsColor; commonIndicator?: string; ...
1,848
( options: DiffOptions = {}, ): DiffOptionsNormalized => ({ ...OPTIONS_DEFAULT, ...options, compareKeys: getCompareKeys(options.compareKeys), contextLines: getContextLines(options.contextLines), })
type DiffOptions = ImportDiffOptions;
1,849
pushDiff(diff: Diff): void { this.line.push(diff); }
class Diff { 0: number; 1: string; constructor(op: number, text: string) { this[0] = op; this[1] = text; } }
1,850
align(diff: Diff): void { const string = diff[1]; if (string.includes('\n')) { const substrings = string.split('\n'); const iLast = substrings.length - 1; substrings.forEach((substring, i) => { if (i < iLast) { // The first substring completes the current change line. ...
class Diff { 0: number; 1: string; constructor(op: number, text: string) { this[0] = op; this[1] = text; } }
1,851
constructor(deleteBuffer: ChangeBuffer, insertBuffer: ChangeBuffer) { this.deleteBuffer = deleteBuffer; this.insertBuffer = insertBuffer; this.lines = []; }
class ChangeBuffer { private readonly op: number; private line: Array<Diff>; // incomplete line private lines: Array<Diff>; // complete lines private readonly changeColor: DiffOptionsColor; constructor(op: number, changeColor: DiffOptionsColor) { this.op = op; this.line = []; this.lines = []; ...
1,852
private pushDiffCommonLine(diff: Diff): void { this.lines.push(diff); }
class Diff { 0: number; 1: string; constructor(op: number, text: string) { this[0] = op; this[1] = text; } }
1,853
private pushDiffChangeLines(diff: Diff): void { const isDiffEmpty = diff[1].length === 0; // An empty diff string is redundant, unless a change line is empty. if (!isDiffEmpty || this.deleteBuffer.isLineEmpty()) { this.deleteBuffer.pushDiff(diff); } if (!isDiffEmpty || this.insertBuffer.isLin...
class Diff { 0: number; 1: string; constructor(op: number, text: string) { this[0] = op; this[1] = text; } }
1,854
align(diff: Diff): void { const op = diff[0]; const string = diff[1]; if (string.includes('\n')) { const substrings = string.split('\n'); const iLast = substrings.length - 1; substrings.forEach((substring, i) => { if (i === 0) { const subdiff = new Diff(op, substring); ...
class Diff { 0: number; 1: string; constructor(op: number, text: string) { this[0] = op; this[1] = text; } }
1,855
function getConsoleOutput( buffer: ConsoleBuffer, config: StackTraceConfig, globalConfig: Config.GlobalConfig, ): string { const TITLE_INDENT = globalConfig.verbose === true ? ' '.repeat(2) : ' '.repeat(4); const CONSOLE_INDENT = TITLE_INDENT + ' '.repeat(2); const logEntries = buffer.reduce((output, {...
type StackTraceConfig = Pick< Config.ProjectConfig, 'rootDir' | 'testMatch' >;
1,856
function getConsoleOutput( buffer: ConsoleBuffer, config: StackTraceConfig, globalConfig: Config.GlobalConfig, ): string { const TITLE_INDENT = globalConfig.verbose === true ? ' '.repeat(2) : ' '.repeat(4); const CONSOLE_INDENT = TITLE_INDENT + ' '.repeat(2); const logEntries = buffer.reduce((output, {...
type ConsoleBuffer = Array<LogEntry>;
1,857
(type: LogType, message: LogMessage) => string
type LogType = | 'assert' | 'count' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'info' | 'log' | 'time' | 'warn';
1,858
(type: LogType, message: LogMessage) => string
type LogMessage = string;
1,859
private _log(type: LogType, message: string) { clearLine(this._stdout); super.log( this._formatBuffer(type, ' '.repeat(this._groupDepth) + message), ); }
type LogType = | 'assert' | 'count' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'info' | 'log' | 'time' | 'warn';
1,860
private _logError(type: LogType, message: string) { clearLine(this._stderr); super.error( this._formatBuffer(type, ' '.repeat(this._groupDepth) + message), ); }
type LogType = | 'assert' | 'count' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'info' | 'log' | 'time' | 'warn';
1,861
private _log(type: LogType, message: LogMessage) { BufferedConsole.write( this._buffer, type, ' '.repeat(this._groupDepth) + message, 3, ); }
type LogType = | 'assert' | 'count' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'info' | 'log' | 'time' | 'warn';
1,862
private _log(type: LogType, message: LogMessage) { BufferedConsole.write( this._buffer, type, ' '.repeat(this._groupDepth) + message, 3, ); }
type LogMessage = string;
1,863
override onRunStart( aggregatedResults: AggregatedResult, options: ReporterOnStartOptions, ): void { this._status.runStarted(aggregatedResults, options); }
type ReporterOnStartOptions = { estimatedTime: number; showStatus: boolean; };
1,864
override onRunStart( aggregatedResults: AggregatedResult, options: ReporterOnStartOptions, ): void { this._status.runStarted(aggregatedResults, options); }
type AggregatedResult = AggregatedResultWithoutCoverage & { coverageMap?: CoverageMap | null; };
1,865
override onTestStart(test: Test): void { this._status.testStarted(test.path, test.context.config); }
type Test = { context: TestContext; duration?: number; path: string; };
1,866
override onTestStart(test: Test): void { this._status.testStarted(test.path, test.context.config); }
type Test = (arg0: any) => boolean;
1,867
override onTestCaseResult(test: Test, testCaseResult: TestCaseResult): void { this._status.addTestCaseResult(test, testCaseResult); }
type Test = { context: TestContext; duration?: number; path: string; };
1,868
override onTestCaseResult(test: Test, testCaseResult: TestCaseResult): void { this._status.addTestCaseResult(test, testCaseResult); }
type Test = (arg0: any) => boolean;
1,869
override onTestCaseResult(test: Test, testCaseResult: TestCaseResult): void { this._status.addTestCaseResult(test, testCaseResult); }
type TestCaseResult = AssertionResult;
1,870
override onTestResult( test: Test, testResult: TestResult, aggregatedResults: AggregatedResult, ): void { this.testFinished(test.context.config, testResult, aggregatedResults); if (!testResult.skipped) { this.printTestFileHeader( testResult.testFilePath, test.context.config, ...
type Test = { context: TestContext; duration?: number; path: string; };
1,871
override onTestResult( test: Test, testResult: TestResult, aggregatedResults: AggregatedResult, ): void { this.testFinished(test.context.config, testResult, aggregatedResults); if (!testResult.skipped) { this.printTestFileHeader( testResult.testFilePath, test.context.config, ...
type Test = (arg0: any) => boolean;
1,872
override onTestResult( test: Test, testResult: TestResult, aggregatedResults: AggregatedResult, ): void { this.testFinished(test.context.config, testResult, aggregatedResults); if (!testResult.skipped) { this.printTestFileHeader( testResult.testFilePath, test.context.config, ...
type AggregatedResult = AggregatedResultWithoutCoverage & { coverageMap?: CoverageMap | null; };
1,873
override onTestResult( test: Test, testResult: TestResult, aggregatedResults: AggregatedResult, ): void { this.testFinished(test.context.config, testResult, aggregatedResults); if (!testResult.skipped) { this.printTestFileHeader( testResult.testFilePath, test.context.config, ...
type TestResult = { console?: ConsoleBuffer; coverage?: CoverageMapData; displayName?: Config.DisplayName; failureMessage?: string | null; leaks: boolean; memoryUsage?: number; numFailingTests: number; numPassingTests: number; numPendingTests: number; numTodoTests: number; openHandles: Array<Error...
1,874
override onTestResult( test: Test, testResult: TestResult, aggregatedResults: AggregatedResult, ): void { this.testFinished(test.context.config, testResult, aggregatedResults); if (!testResult.skipped) { this.printTestFileHeader( testResult.testFilePath, test.context.config, ...
type TestResult = { duration?: number | null; errors: Array<FormattedError>; errorsDetailed: Array<MatcherResults | unknown>; invocations: number; status: TestStatus; location?: {column: number; line: number} | null; numPassingAsserts: number; retryReasons: Array<FormattedError>; testPath: Array<TestN...
1,875
( test: Test, testResult: TestResult, aggregatedResult: AggregatedResult, ) => Promise<void> | void
type Test = { context: TestContext; duration?: number; path: string; };
1,876
( test: Test, testResult: TestResult, aggregatedResult: AggregatedResult, ) => Promise<void> | void
type Test = (arg0: any) => boolean;
1,877
( test: Test, testResult: TestResult, aggregatedResult: AggregatedResult, ) => Promise<void> | void
type AggregatedResult = AggregatedResultWithoutCoverage & { coverageMap?: CoverageMap | null; };
1,878
( test: Test, testResult: TestResult, aggregatedResult: AggregatedResult, ) => Promise<void> | void
type TestResult = { console?: ConsoleBuffer; coverage?: CoverageMapData; displayName?: Config.DisplayName; failureMessage?: string | null; leaks: boolean; memoryUsage?: number; numFailingTests: number; numPassingTests: number; numPendingTests: number; numTodoTests: number; openHandles: Array<Error...
1,879
( test: Test, testResult: TestResult, aggregatedResult: AggregatedResult, ) => Promise<void> | void
type TestResult = { duration?: number | null; errors: Array<FormattedError>; errorsDetailed: Array<MatcherResults | unknown>; invocations: number; status: TestStatus; location?: {column: number; line: number} | null; numPassingAsserts: number; retryReasons: Array<FormattedError>; testPath: Array<TestN...
1,880
( test: Test, testCaseResult: TestCaseResult, ) => Promise<void> | void
type Test = { context: TestContext; duration?: number; path: string; };
1,881
( test: Test, testCaseResult: TestCaseResult, ) => Promise<void> | void
type Test = (arg0: any) => boolean;
1,882
( test: Test, testCaseResult: TestCaseResult, ) => Promise<void> | void
type TestCaseResult = AssertionResult;
1,883
( results: AggregatedResult, options: ReporterOnStartOptions, ) => Promise<void> | void
type ReporterOnStartOptions = { estimatedTime: number; showStatus: boolean; };
1,884
( results: AggregatedResult, options: ReporterOnStartOptions, ) => Promise<void> | void
type AggregatedResult = AggregatedResultWithoutCoverage & { coverageMap?: CoverageMap | null; };
1,885
(test: Test) => Promise<void> | void
type Test = { context: TestContext; duration?: number; path: string; };
1,886
(test: Test) => Promise<void> | void
type Test = (arg0: any) => boolean;
1,887
override onTestResult(_test: Test, testResult: TestResult): void { if (testResult.v8Coverage) { this._v8CoverageResults.push(testResult.v8Coverage); return; } if (testResult.coverage) { this._coverageMap.merge(testResult.coverage); } }
type Test = { context: TestContext; duration?: number; path: string; };
1,888
override onTestResult(_test: Test, testResult: TestResult): void { if (testResult.v8Coverage) { this._v8CoverageResults.push(testResult.v8Coverage); return; } if (testResult.coverage) { this._coverageMap.merge(testResult.coverage); } }
type Test = (arg0: any) => boolean;
1,889
override onTestResult(_test: Test, testResult: TestResult): void { if (testResult.v8Coverage) { this._v8CoverageResults.push(testResult.v8Coverage); return; } if (testResult.coverage) { this._coverageMap.merge(testResult.coverage); } }
type TestResult = { console?: ConsoleBuffer; coverage?: CoverageMapData; displayName?: Config.DisplayName; failureMessage?: string | null; leaks: boolean; memoryUsage?: number; numFailingTests: number; numPassingTests: number; numPendingTests: number; numTodoTests: number; openHandles: Array<Error...
1,890
override onTestResult(_test: Test, testResult: TestResult): void { if (testResult.v8Coverage) { this._v8CoverageResults.push(testResult.v8Coverage); return; } if (testResult.coverage) { this._coverageMap.merge(testResult.coverage); } }
type TestResult = { duration?: number | null; errors: Array<FormattedError>; errorsDetailed: Array<MatcherResults | unknown>; invocations: number; status: TestStatus; location?: {column: number; line: number} | null; numPassingAsserts: number; retryReasons: Array<FormattedError>; testPath: Array<TestN...
1,891
function getResultHeader( result: TestResult, globalConfig: Config.GlobalConfig, projectConfig?: Config.ProjectConfig, ): string { const testPath = result.testFilePath; const status = result.numFailingTests > 0 || result.testExecError ? FAIL : PASS; const testDetail = []; if (result.perfStats?.slow)...
type TestResult = { console?: ConsoleBuffer; coverage?: CoverageMapData; displayName?: Config.DisplayName; failureMessage?: string | null; leaks: boolean; memoryUsage?: number; numFailingTests: number; numPassingTests: number; numPendingTests: number; numTodoTests: number; openHandles: Array<Error...
1,892
function getResultHeader( result: TestResult, globalConfig: Config.GlobalConfig, projectConfig?: Config.ProjectConfig, ): string { const testPath = result.testFilePath; const status = result.numFailingTests > 0 || result.testExecError ? FAIL : PASS; const testDetail = []; if (result.perfStats?.slow)...
type TestResult = { duration?: number | null; errors: Array<FormattedError>; errorsDetailed: Array<MatcherResults | unknown>; invocations: number; status: TestStatus; location?: {column: number; line: number} | null; numPassingAsserts: number; retryReasons: Array<FormattedError>; testPath: Array<TestN...
1,893
function getSummary( aggregatedResults: AggregatedResult, options?: SummaryOptions, ): string { let runTime = (Date.now() - aggregatedResults.startTime) / 1000; if (options && options.roundTime) { runTime = Math.floor(runTime); } const valuesForCurrentTestCases = getValuesCurrentTestCases( options?...
type AggregatedResult = AggregatedResultWithoutCoverage & { coverageMap?: CoverageMap | null; };
1,894
function getSummary( aggregatedResults: AggregatedResult, options?: SummaryOptions, ): string { let runTime = (Date.now() - aggregatedResults.startTime) / 1000; if (options && options.roundTime) { runTime = Math.floor(runTime); } const valuesForCurrentTestCases = getValuesCurrentTestCases( options?...
type SummaryOptions = { currentTestCases?: Array<{test: Test; testCaseResult: TestCaseResult}>; estimatedTime?: number; roundTime?: boolean; width?: number; showSeed?: boolean; seed?: number; };
1,895
onRunStart( _results?: AggregatedResult, _options?: ReporterOnStartOptions, ): void { preRunMessageRemove(process.stderr); }
type ReporterOnStartOptions = { estimatedTime: number; showStatus: boolean; };
1,896
onRunStart( _results?: AggregatedResult, _options?: ReporterOnStartOptions, ): void { preRunMessageRemove(process.stderr); }
type AggregatedResult = AggregatedResultWithoutCoverage & { coverageMap?: CoverageMap | null; };
1,897
onTestCaseResult(_test: Test, _testCaseResult: TestCaseResult): void {}
type Test = { context: TestContext; duration?: number; path: string; };
1,898
onTestCaseResult(_test: Test, _testCaseResult: TestCaseResult): void {}
type Test = (arg0: any) => boolean;
1,899
onTestCaseResult(_test: Test, _testCaseResult: TestCaseResult): void {}
type TestCaseResult = AssertionResult;