1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import type { AssertionError } from 'assert';
|
9 | import type { Config } from '@jest/types';
|
10 | import expect = require('expect');
|
11 | import type CallTracker from './jasmine/CallTracker';
|
12 | import type Env from './jasmine/Env';
|
13 | import type JsApiReporter from './jasmine/JsApiReporter';
|
14 | import type ReportDispatcher from './jasmine/ReportDispatcher';
|
15 | import type { default as Spec, SpecResult } from './jasmine/Spec';
|
16 | import type SpyStrategy from './jasmine/SpyStrategy';
|
17 | import type { default as Suite, SuiteResult } from './jasmine/Suite';
|
18 | import type Timer from './jasmine/Timer';
|
19 | import type createSpy from './jasmine/createSpy';
|
20 | import type SpyRegistry from './jasmine/spyRegistry';
|
21 | export declare type SpecDefinitionsFn = () => void;
|
22 | export interface AssertionErrorWithStack extends AssertionError {
|
23 | stack: string;
|
24 | }
|
25 | export declare type SyncExpectationResult = {
|
26 | pass: boolean;
|
27 | message: () => string;
|
28 | };
|
29 | export declare type AsyncExpectationResult = Promise<SyncExpectationResult>;
|
30 | export declare type ExpectationResult = SyncExpectationResult | AsyncExpectationResult;
|
31 | export declare type RawMatcherFn = (expected: unknown, actual: unknown, options?: unknown) => ExpectationResult;
|
32 | export declare type RunDetails = {
|
33 | totalSpecsDefined?: number;
|
34 | failedExpectations?: SuiteResult['failedExpectations'];
|
35 | };
|
36 | export declare type Reporter = {
|
37 | jasmineDone: (runDetails: RunDetails) => void;
|
38 | jasmineStarted: (runDetails: RunDetails) => void;
|
39 | specDone: (result: SpecResult) => void;
|
40 | specStarted: (spec: SpecResult) => void;
|
41 | suiteDone: (result: SuiteResult) => void;
|
42 | suiteStarted: (result: SuiteResult) => void;
|
43 | };
|
44 | export interface Spy extends Record<string, any> {
|
45 | (this: Record<string, unknown>, ...args: Array<any>): unknown;
|
46 | and: SpyStrategy;
|
47 | calls: CallTracker;
|
48 | restoreObjectToOriginalState?: () => void;
|
49 | }
|
50 | declare type JasmineMatcher = {
|
51 | (matchersUtil: unknown, context: unknown): JasmineMatcher;
|
52 | compare: () => RawMatcherFn;
|
53 | negativeCompare: () => RawMatcherFn;
|
54 | };
|
55 | export declare type JasmineMatchersObject = {
|
56 | [id: string]: JasmineMatcher;
|
57 | };
|
58 | export declare type Jasmine = {
|
59 | _DEFAULT_TIMEOUT_INTERVAL: number;
|
60 | DEFAULT_TIMEOUT_INTERVAL: number;
|
61 | currentEnv_: ReturnType<typeof Env>['prototype'];
|
62 | getEnv: () => ReturnType<typeof Env>['prototype'];
|
63 | createSpy: typeof createSpy;
|
64 | Env: ReturnType<typeof Env>;
|
65 | JsApiReporter: typeof JsApiReporter;
|
66 | ReportDispatcher: typeof ReportDispatcher;
|
67 | Spec: typeof Spec;
|
68 | SpyRegistry: typeof SpyRegistry;
|
69 | Suite: typeof Suite;
|
70 | Timer: typeof Timer;
|
71 | version: string;
|
72 | testPath: Config.Path;
|
73 | addMatchers: (matchers: JasmineMatchersObject) => void;
|
74 | } & typeof expect & typeof globalThis;
|
75 | declare global {
|
76 | namespace NodeJS {
|
77 | interface Global {
|
78 | expect: typeof expect;
|
79 | }
|
80 | }
|
81 | }
|
82 | export {};
|