UNPKG

@angular-package/testing

Version:

Jasmine unit testing wrapper with additional custom testing features.

55 lines (54 loc) 4.48 kB
import { TestingActual } from "./testing-actual.class"; import { TestingDescribe } from "./testing-describe.class"; import { TestingExpectation } from './testing-expectation.class'; import { TestingIt } from "./testing-it.class"; import { Constructor } from "@angular-package/type"; import { CounterConfig, ExpectType } from "../type"; import { ExecutableTests } from "../interface/executable-tests.interface"; export declare class TestingCustom<T extends Constructor<any>[] = [], Descriptions extends string = string, Expectations extends string = string> { static defineDescribe(description: string, specDefinitions: () => void): (execute: boolean) => void; static defineIt(expectation: string, assertion: jasmine.ImplementationCallback, timeout?: number | undefined): (execute: boolean) => void; get descriptions(): Descriptions[]; get expect(): TestingExpectation; get expectations(): Expectations[]; get testing(): import("../type").UnionToIntersection<import("../type").InstanceOfConstructor<T[number]>>; protected allowDescribe: boolean; protected allowIt: boolean; protected executable?: ExecutableTests; protected testingCore: { readonly expect: TestingExpectation; readonly testingDescribe: TestingDescribe<Descriptions, boolean, boolean>; readonly testingIt: TestingIt<Expectations, boolean, boolean>; "__#7@#expectation": TestingExpectation; "__#7@#testingDescribe": TestingDescribe<Descriptions, boolean, boolean>; "__#7@#testingIt": TestingIt<Expectations, boolean, boolean>; afterAll(action: jasmine.ImplementationCallback, timeout?: number, execute?: boolean): any; afterEach(action: jasmine.ImplementationCallback, timeout?: number, execute?: boolean): any; beforeAll(action: jasmine.ImplementationCallback, timeout?: number, execute?: boolean): any; beforeEach(action: jasmine.ImplementationCallback, timeout?: number, execute?: boolean): any; describe<Description extends string>(description: Descriptions | Description, specDefinitions: () => any, execute?: boolean): any; fdescribe<Description extends string>(description: Descriptions | Description, specDefinitions: () => any): any; it<Expectation extends string>(expectation: Expectations | Expectation, assertion: jasmine.ImplementationCallback, execute?: boolean): any; setSpecProperty(key: string, value: unknown): any; setSuiteProperty(key: string, value: unknown): any; spec<T_1>(assertion: (expectation: TestingExpectation) => any, description?: string, execute?: boolean): any; xdescribe<Description extends string>(description: Descriptions | Description, specDefinitions: () => any): any; }; private $testing; private $descriptions; private $expectations; constructor(testing: T, allowDescribe?: boolean, allowIt?: boolean, executable?: ExecutableTests, descriptions?: Descriptions[], expectations?: Expectations[], counter?: CounterConfig, testingDescribe?: TestingDescribe, testingIt?: TestingIt, testingExpectation?: TestingExpectation); actual<T>(actual: ExpectType<T>, specDefinitions: (test: TestingActual) => TestingActual): this; afterAll(action: jasmine.ImplementationCallback, timeout?: number, execute?: boolean): this; afterEach(action: jasmine.ImplementationCallback, timeout?: number, execute?: boolean): this; beforeAll(action: jasmine.ImplementationCallback, timeout?: number, execute?: boolean): this; beforeEach(action: jasmine.ImplementationCallback, timeout?: number, execute?: boolean): this; describe<Description extends string>(description: Descriptions | Description, specDefinitions: () => any, execute?: boolean): this; fdescribe<Description extends string>(description: Descriptions | Description, specDefinitions: () => any): this; it<Expectation extends string>(expectation: Expectations | Expectation, assertion: jasmine.ImplementationCallback, execute?: boolean): this; setSpecProperty(key: string, value: unknown): this; setSuiteProperty(key: string, value: unknown): this; spec<T>(assertion: (expectation: TestingExpectation) => any, description?: string, execute?: boolean): this; spy<T extends jasmine.Func>(spy: () => ExpectType<T>, specDefinitions: (test: TestingActual) => TestingActual): this; xdescribe<Description extends string>(description: Descriptions | Description, specDefinitions: () => any): this; }