@angular-package/testing
Version:
Jasmine unit testing wrapper with additional custom testing features.
106 lines (105 loc) • 11.9 kB
TypeScript
import { Expect } from './expect.class';
import { TestingExpect } from './testing-expect.class';
import { TestingExpectTo } from './expectation/testing-expect-to.class';
import { Constructor } from '@angular-package/type';
import { ExpectType } from '../type';
export declare class TestingExpectation extends Expect {
#private;
get to(): TestingExpectTo;
constructor(expect?: TestingExpect);
toBe<T>(actual: ExpectType<T>, expected: jasmine.Expected<typeof actual>, expectationFailOutput?: any): this;
toBeArray<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfBigInt<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfBoolean<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfDate<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfDefined<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfFalse<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfNull<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfNumber<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfRegExp<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfString<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfSymbol<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfTrue<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeArrayOfUndefined<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeBigInt<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeBoolean<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeBooleanType<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeClass<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeCloseTo<T extends number>(actual: ExpectType<T>, expected: number, precision?: any, expectationFailOutput?: any): this;
toBeDate<T>(actual: ExpectType<T>, expected: any, expectationFailOutput?: any): this;
toBeDefined<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeFalse<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeFalsy<T>(actual: ExpectType<T>, expected: any, expectationFailOutput?: any): this;
toBeFunction<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeGreaterThan<T extends number>(actual: ExpectType<T>, expected: number, expectationFailOutput?: any): this;
toBeGreaterThanOrEqual<T extends number>(actual: ExpectType<T>, expected: number, expectationFailOutput?: any): this;
toBeInstance<T, Type>(actual: ExpectType<T>, constructor: Constructor<Type>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOf<T>(actual: ExpectType<T>, expected: jasmine.Constructor, expectationFailOutput?: any): this;
toBeInstanceOfArray<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfBoolean<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfDate<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfError<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfFunction<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfMap<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfNumber<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfObject<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfPromise<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfRangeError<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfReferenceError<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfRegExp<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfSet<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfStorage<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfString<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfSyntaxError<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfTypeError<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfURIError<T>(actual: ExpectType<T>, expected: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeInstanceOfWeakSet<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeKey<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeLessThan<T extends number>(actual: ExpectType<T>, expected: number, expectationFailOutput?: any): this;
toBeLessThanOrEqual<T extends number>(actual: ExpectType<T>, expected: number, expectationFailOutput?: any): this;
toBeNaN<T extends number>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeNegativeInfinity<T extends number>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeNull<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeNumber<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeNumberBetween<T, Min extends number, Max extends number>(actual: ExpectType<T>, min: Min, max: Max, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeNumberType<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeObject<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeObjectKey<T>(actual: ExpectType<T>, key: PropertyKey, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeObjectKeyIn<T>(actual: ExpectType<T>, key: PropertyKey, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeObjectKeys<T>(actual: ExpectType<T>, keys: PropertyKey[], expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeObjectKeysIn<T>(actual: ExpectType<T>, keys: PropertyKey[], expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeObjectSomeKeys<T>(actual: ExpectType<T>, keys: (PropertyKey | PropertyKey[])[], expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBePending<T>(actual: T | PromiseLike<T>, expectationFailOutput?: any): this;
toBePositiveInfinity<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeRegExp<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeRejected<T>(actual: T | PromiseLike<T>, expectationFailOutput?: any): this;
toBeRejectedWith<T, U>(actual: T | PromiseLike<T>, expected: jasmine.Expected<U>, expectationFailOutput?: any): this;
toBeRejectedWithError<T, U>(actual: T | PromiseLike<T>, expected?: new (...args: any[]) => Error, message?: string | RegExp, expectationFailOutput?: any): this;
toBeResolved<T>(actual: T | PromiseLike<T>, expectationFailOutput?: any): this;
toBeResolvedTo<T>(actual: T | PromiseLike<T>, expected: jasmine.Expected<T>, expectationFailOutput?: any): this;
toBeString<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeStringIncludes<T>(actual: ExpectType<T>, includes: string[], expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeStringIncludesSome<T>(actual: ExpectType<T>, includes: string[], expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeStringOfLength<T, Length extends number>(actual: ExpectType<T>, length: Length, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeStringOfLengthBetween<T, Min extends number, Max extends number>(actual: ExpectType<T>, min: Min, max: Max, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeStringType<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeSymbol<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeTrue<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeTruthy<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toBeTypeOf<T>(actual: ExpectType<T>, expected: jasmine.Expected<string>, expectationFailOutput?: any): this;
toBeUndefined<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectationFailOutput?: any): this;
toContain<T>(actual: ExpectType<T>, expected: any, expectationFailOutput?: any): this;
toEqual<T>(actual: ExpectType<T>, expected: jasmine.Expected<typeof actual>, expectationFailOutput?: any): this;
toHaveBeenCalled<T extends jasmine.Func>(spy: ExpectType<T>, expectationFailOutput?: any): this;
toHaveBeenCalledBefore<T extends jasmine.Func>(spy: ExpectType<T>, expected: jasmine.Func, expectationFailOutput?: any): this;
toHaveBeenCalledOnceWith<T extends jasmine.Func>(spy: ExpectType<T>, ...params: any[]): this;
toHaveBeenCalledTimes<T extends jasmine.Func>(spy: ExpectType<T>, expected: number, expectationFailOutput?: any): this;
toHaveBeenCalledWith<T extends jasmine.Func>(spy: ExpectType<T>, ...params: any[]): this;
toHaveClass<T>(actual: ExpectType<T>, expected: string, expectationFailOutput?: any): this;
toHaveSize<T>(actual: ExpectType<T>, expected: number, expectationFailOutput?: any): this;
toHaveSpyInteractions<T>(actual: ExpectType<T>, expectationFailOutput?: any): this;
toMatch<T>(actual: ExpectType<T>, expected: string | RegExp, expectationFailOutput?: any): this;
toThrow<T>(actual: ExpectType<T>, expected?: any, expectationFailOutput?: any): this;
toThrowError<T extends jasmine.Func>(actual: ExpectType<T>, message?: string | RegExp, expectationFailOutput?: any): this;
toThrowMatching<T>(actual: ExpectType<T>, predicate: (thrown: any) => boolean, expectationFailOutput?: any): this;
}