UNPKG

@angular-package/testing

Version:

Jasmine unit testing wrapper with additional custom testing features.

96 lines (95 loc) 14 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 { Constructor } from '@angular-package/type'; import { CounterConfig } from '../type/counter-config.type'; import { ExpectType } from '../type'; import { ExecutableTests } from '../interface/executable-tests.interface'; export declare class TestingActual<Descriptions extends string = string, Expectations extends string = string> extends TestingCore<Descriptions, Expectations> { #private; constructor(allowDescribe?: boolean, allowIt?: boolean, executable?: ExecutableTests, counter?: CounterConfig, testingDescribe?: TestingDescribe, testingIt?: TestingIt, testingExpectation?: TestingExpectation); actual<T>(actual: ExpectType<T>): this; spy<T extends jasmine.Func>(spy: () => ExpectType<T>): this; toBe<T>(expected: jasmine.Expected<typeof actual>, expectation: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeArray<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeBigInt<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeBoolean<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this; toBeBooleanType<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeClass<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeCloseTo<T extends number>(expected: number, precision?: any, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeDate<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeDefined<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeFalse<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeFalsy<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeFunction<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeGreaterThan<T extends number>(expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeGreaterThanOrEqual<T extends number>(expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstance<T, Type>(constructor: Constructor<Type>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOf<T>(expected: jasmine.Constructor, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfArray<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfBoolean<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfDate<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfError<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfFunction<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfMap<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfNumber<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfObject<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfPromise<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfRangeError<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfReferenceError<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfRegExp<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfSet<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfStorage<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfString<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfSyntaxError<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfTypeError<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfURIError<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeInstanceOfWeakSet<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeKey<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeLessThan<T extends number>(expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeLessThanOrEqual<T extends number>(expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeNaN<T extends number>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeNegativeInfinity<T extends number>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeNull<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeNumber<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeNumberBetween<T, Min extends number, Max extends number>(min: Min, max: Max, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeNumberType<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeObject<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeObjectKey<T>(key: PropertyKey, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeObjectKeyIn<T>(key: PropertyKey, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeObjectKeys<T>(actual: ExpectType<T>, keys: PropertyKey[], expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this; objectKeysIn<T>(keys: PropertyKey[], expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; objectSomeKeys<T>(keys: PropertyKey[], expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBePositiveInfinity<T extends number>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeRegExp<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeRejected<T>(expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: T | PromiseLike<T>): this; toBeRejectedWith<T>(expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: T | PromiseLike<T>): this; toBeRejectedWithError<T>(expected?: new (...args: any[]) => Error, message?: string | RegExp, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: T | PromiseLike<T>): this; toBeResolved<T>(expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: T | PromiseLike<T>): this; toBeResolvedTo<T>(expected: jasmine.Expected<T>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: T | PromiseLike<T>): this; toBeString<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; stringIncludes<T>(includes: string[], expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; stringIncludesSome<T>(includes: string[], expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; stringOfLength<T, Length extends number>(length: Length, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; stringOfLengthBetween<T, Min extends number, Max extends number>(min: Min, max: Max, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeStringType<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeSymbol<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeTrue<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeTruthy<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toBeUndefined<T>(expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toContain<T>(expected: any, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toEqual<T>(expected: jasmine.Expected<typeof actual>, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toHaveBeenCalled<T extends jasmine.Func>(expectation?: string, expectationFailOutput?: any, execute?: boolean, spy?: () => ExpectType<T>): this; toHaveBeenCalledBefore<T extends jasmine.Func>(expected: jasmine.Func, expectation?: string, expectationFailOutput?: any, execute?: boolean, spy?: () => ExpectType<T>): this; toHaveBeenCalledOnceWith(...params: any[]): this; toHaveBeenCalledTimes<T extends jasmine.Func>(expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean, spy?: () => ExpectType<T>): this; toHaveBeenCalledWith(...params: any[]): this; toHaveClass<T>(expected: string, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toHaveSize<T>(expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toHaveSpyInteractions<T>(expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toMatch<T>(expected: string | RegExp, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toThrow<T>(expected?: any, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toThrowError<T extends jasmine.Func>(message?: string | RegExp, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; toThrowMatching<T>(predicate: (thrown: any) => boolean, expectation?: string, expectationFailOutput?: any, execute?: boolean, actual?: ExpectType<T>): this; }