UNPKG

@angular-package/testing

Version:

Jasmine unit testing wrapper with additional custom testing features.

51 lines (50 loc) 4.87 kB
import { TestingToBeArrayOf, TestingToBeBoolean, TestingToBeGreaterThan, TestingToBeInstanceOf, TestingToBeLessThan, TestingToBeNumber, TestingToBeObject, TestingToBeString, TestingToBe, TestingToHave, TestingToThrow, TestingTo } from './testing'; 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 { ExecutableTests } from '../interface/executable-tests.interface'; import { CounterConfig, ExpectType } from '../type'; declare const Testing_base: import("@angular-package/type").Constructor<TestingTo<string, string> & TestingToBe<string, string> & TestingToBeArrayOf<string, string> & TestingToBeBoolean<string, string> & TestingToBeGreaterThan<string, string> & TestingToBeInstanceOf<string, string> & TestingToBeLessThan<string, string> & TestingToBeNumber<string, string> & TestingToBeObject<string, string> & TestingToBeString<string, string> & TestingToHave<string, string> & TestingToThrow<string, string>>; export declare class Testing<Descriptions extends string = string, Expectations extends string = string> extends Testing_base { static defineDescribe(description: string, specDefinitions: () => void): (execute: boolean) => void; static defineIt(expectation: string, assertion: jasmine.ImplementationCallback, timeout?: number | undefined): (execute: boolean) => void; get expect(): TestingExpectation; 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>(assertion: (expectation: TestingExpectation) => any, description?: string, execute?: boolean): any; xdescribe<Description extends string>(description: Descriptions | Description, specDefinitions: () => any): any; }; constructor(allowDescribe?: boolean, allowIt?: boolean, executable?: ExecutableTests, counter?: CounterConfig, testingDescribe?: TestingDescribe<string, boolean, boolean>, testingIt?: TestingIt<string, boolean, boolean>, 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; } export {};