/** * Copyright (c) Microsoft Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { expect } from './expect'; import { FixturePool } from './fixtures'; import { TestModifier } from './testModifier'; export declare type SpecType = 'default' | 'skip' | 'only'; export declare type Implementation = { it: (spec: SpecType, folio: FolioImpl, ...args: any[]) => void; describe: (spec: SpecType, folio: FolioImpl, ...args: any[]) => void; beforeEach: (folio: FolioImpl, fn: Function) => void; afterEach: (folio: FolioImpl, fn: Function) => void; beforeAll: (folio: FolioImpl, fn: Function) => void; afterAll: (folio: FolioImpl, fn: Function) => void; }; export declare function setImplementation(i: Implementation): void; interface DescribeHelper { describe(name: string, inner: () => void): void; describe(name: string, modifierFn: (modifier: TestModifier, parameters: WorkerParameters) => any, inner: () => void): void; } declare type DescribeFunction = DescribeHelper['describe']; interface ItHelper { it(name: string, inner: (fixtures: WorkerParameters & WorkerFixtures & TestFixtures) => Promise | void): void; it(name: string, modifierFn: (modifier: TestModifier, parameters: WorkerParameters) => any, inner: (fixtures: WorkerParameters & WorkerFixtures & TestFixtures) => Promise | void): void; } declare type ItFunction = ItHelper['it']; declare type It = ItFunction & { only: ItFunction; skip: ItFunction; }; declare type Fit = ItFunction; declare type Xit = ItFunction; declare type Describe = DescribeFunction & { only: DescribeFunction; skip: DescribeFunction; }; declare type BeforeEach = (inner: (fixtures: WorkerParameters & WorkerFixtures & TestFixtures) => Promise) => void; declare type AfterEach = (inner: (fixtures: WorkerParameters & WorkerFixtures & TestFixtures) => Promise) => void; declare type BeforeAll = (inner: (fixtures: WorkerFixtures) => Promise) => void; declare type AfterAll = (inner: (fixtures: WorkerFixtures) => Promise) => void; export declare class FolioImpl { it: It; fit: Fit; xit: Xit; test: It; describe: Describe; beforeEach: BeforeEach; afterEach: AfterEach; beforeAll: BeforeAll; afterAll: AfterAll; expect: typeof expect; _pool: FixturePool; constructor(pool: FixturePool); union(other: Folio): Folio; extend(): Fixtures; generateParametrizedTests(name: T, values: WorkerParameters[T][]): void; } declare type TestFixtureOptions = { auto?: boolean; scope?: 'test'; }; declare type WorkerFixtureOptions = { auto?: boolean; scope: 'worker'; }; declare type WorkerParameterInitializer = { initParameter(description: string, defaultValue: R): void; }; declare type WorkerFixtureInitializer = { init(fixture: (params: PW, runTest: (value: R) => Promise) => Promise, options: WorkerFixtureOptions): void; }; declare type WorkerFixtureOverrider = { override(fixture: (params: PW, runTest: (value: R) => Promise) => Promise): void; }; declare type TestFixtureInitializer = { init(fixture: (params: PWT, runTest: (value: R) => Promise) => Promise, options?: TestFixtureOptions): void; }; declare type TestFixtureOverrider = { override(fixture: (params: PWT, runTest: (value: R) => Promise) => Promise): void; }; declare type Fixtures = { [X in keyof P]: WorkerParameterInitializer; } & { [X in keyof W]: WorkerFixtureInitializer; } & { [X in keyof T]: TestFixtureInitializer; } & { [X in keyof WorkerFixtures]: WorkerFixtureOverrider; } & { [X in keyof TestFixtures]: TestFixtureOverrider; } & { build(): Folio; }; export interface Folio extends FolioImpl { } export declare const rootFixtures: Folio<{}, {}, {}>; export {}; //# sourceMappingURL=spec.d.ts.map