Aktueller Stand
This commit is contained in:
28
backend/node_modules/@prisma/get-platform/dist/test-utils/jestContext.d.ts
generated
vendored
28
backend/node_modules/@prisma/get-platform/dist/test-utils/jestContext.d.ts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
/// <reference types="jest" />
|
||||
import type { ExecaChildProcess } from 'execa';
|
||||
import { type ExecaChildProcess } from 'execa';
|
||||
import type { FSJetpack } from 'fs-jetpack/types';
|
||||
/**
|
||||
* Base test context.
|
||||
@@ -75,10 +75,6 @@ export declare const jestContext: {
|
||||
assemble(): BaseContext;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Factory for creating a context contributor possibly configured in some special way.
|
||||
*/
|
||||
type ContextContributorFactory<Settings, Context, NewContext> = Settings extends {} ? () => ContextContributor<Context, NewContext> : (settings: Settings) => ContextContributor<Context, NewContext>;
|
||||
/**
|
||||
* A function that provides additional test context.
|
||||
*/
|
||||
@@ -94,7 +90,7 @@ type ConsoleContext = {
|
||||
'console.warn': jest.SpyInstance;
|
||||
};
|
||||
};
|
||||
export declare const jestConsoleContext: ContextContributorFactory<{}, BaseContext, ConsoleContext>;
|
||||
export declare const jestConsoleContext: <Ctx extends BaseContext>() => (c: Ctx) => Ctx & ConsoleContext;
|
||||
/**
|
||||
* Test context contributor. Mocks process.std(out|err).write with a Jest spy before each test.
|
||||
*/
|
||||
@@ -103,6 +99,24 @@ type ProcessContext = {
|
||||
'process.stderr.write': jest.SpyInstance;
|
||||
'process.stdout.write': jest.SpyInstance;
|
||||
};
|
||||
normalizedCapturedStdout: () => string;
|
||||
normalizedCapturedStderr: () => string;
|
||||
clearCapturedStdout: () => void;
|
||||
clearCapturedStderr: () => void;
|
||||
};
|
||||
export declare const jestProcessContext: ContextContributorFactory<{}, BaseContext, ProcessContext>;
|
||||
type NormalizationRule = [RegExp | string, string];
|
||||
export type ProcessContextSettings = {
|
||||
normalizationRules: NormalizationRule[];
|
||||
};
|
||||
export declare const jestStdoutContext: <Ctx extends BaseContext>({ normalizationRules }?: ProcessContextSettings) => (c: Ctx) => Ctx & ProcessContext;
|
||||
/**
|
||||
* Test context contributor. Mocks process.exit with a spay and records the exit code.
|
||||
*/
|
||||
type ProcessExitContext = {
|
||||
mocked: {
|
||||
'process.exit': jest.SpyInstance;
|
||||
};
|
||||
recordedExitCode: () => number;
|
||||
};
|
||||
export declare const processExitContext: <C extends BaseContext>() => (c: C) => C & ProcessExitContext;
|
||||
export {};
|
||||
|
||||
Reference in New Issue
Block a user