UNPKG

@angular-package/testing

Version:

Jasmine unit testing wrapper with additional custom testing features.

20 lines (19 loc) 2.02 kB
import { TestingCore } from '../testing-core.abstract'; import { TestingDescribe } from '../testing-describe.class'; import { TestingExpectation } from '../testing-expectation.class'; import { TestingIt } from '../testing-it.class'; import { TestingItToHave } from '../it'; import { CounterConfig, ExpectType } from '../../type'; import { ExecutableTests } from '../../interface/executable-tests.interface'; export declare class TestingToHave<Descriptions extends string = string, Expectations extends string = string> extends TestingCore<Descriptions, Expectations> { protected toHave: TestingItToHave; constructor(allowDescribe?: boolean, allowIt?: boolean, executable?: ExecutableTests, counter?: CounterConfig, testingDescribe?: TestingDescribe, testingIt?: TestingIt, testingExpectation?: TestingExpectation); toHaveBeenCalled<T extends jasmine.Func>(spy: () => ExpectType<T> | ExpectType<T>[], expectation?: string, expectationFailOutput?: any, execute?: boolean): this; toHaveBeenCalledBefore<T extends jasmine.Func>(spyExpected: () => [ExpectType<T>, jasmine.Func], expectation?: string, expectationFailOutput?: any, execute?: boolean): this; toHaveBeenCalledOnceWith<Actual extends jasmine.Func>(expectation: string | undefined, spy: ExpectType<Actual>, ...params: any[]): this; toHaveBeenCalledTimes<T extends jasmine.Func>(spy: () => ExpectType<T>, expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean): this; toHaveBeenCalledWith<T extends jasmine.Func>(expectation: string | undefined, spy: () => ExpectType<T>, ...params: any[]): this; toHaveClass<T>(actual: ExpectType<T>, expected: string, expectation?: string, expectationFailOutput?: any, execute?: boolean): this; toHaveSize<T>(actual: ExpectType<T>, expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean): this; toHaveSpyInteractions<T>(actual: ExpectType<T>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this; }