@angular-package/testing
Version:
Jasmine unit testing wrapper with additional custom testing features.
65 lines (64 loc) • 8.82 kB
TypeScript
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 { TestingItToBeArrayOf } from './testing-it-to-be-arrayof.class';
import { TestingItToBeBoolean } from './testing-it-to-be-boolean.class';
import { TestingItToBeInstanceOf } from './testing-it-to-be-instanceof.class';
import { Constructor } from '@angular-package/type';
import { ExpectType, CounterConfig } from '../../type';
import { ExecutableTests } from '../../interface/executable-tests.interface';
export declare class TestingItToBe<Descriptions extends string = string, Expectations extends string = string> extends TestingCore<Descriptions, Expectations> {
#private;
get arrayof(): TestingItToBeArrayOf<string, string>;
get boolean(): TestingItToBeBoolean<string, string>;
get instanceof(): TestingItToBeInstanceOf<string, string>;
constructor(allowDescribe: boolean, allowIt: boolean, executable?: ExecutableTests, counter?: CounterConfig, testingDescribe?: TestingDescribe, testingIt?: TestingIt, testingExpectation?: TestingExpectation);
be<T>(actual: ExpectType<T>, expected: jasmine.Expected<typeof actual>, expectation: string, expectationFailOutput?: any, execute?: boolean): this;
array<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
bigInt<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
class<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
closeTo<T extends number>(actual: ExpectType<T>, expected: number, precision?: any, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
date<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
defined<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
false<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
falsy<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
function<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
greaterThan<T extends number>(actual: ExpectType<T>, expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
greaterThanOrEqual<T extends number>(actual: ExpectType<T>, expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
instance<T, Type>(actual: ExpectType<T>, constructor: Constructor<Type>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
instanceOf<T>(actual: ExpectType<T>, expected: jasmine.Constructor, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
key<T, Type>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
lessThan<T extends number>(actual: ExpectType<T>, expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
lessThanOrEqual<T extends number>(actual: ExpectType<T>, expected: number, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
naN<T extends number>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
negativeInfinity<T extends number>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
null<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
number<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
numberBetween<T, Min extends number, Max extends number>(actual: ExpectType<T>, min: Min, max: Max, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
numberType<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
object<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
objectKey<T>(actual: ExpectType<T>, key: PropertyKey, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
objectKeyIn<T>(actual: ExpectType<T>, key: PropertyKey, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
objectKeys<T>(actual: ExpectType<T>, keys: PropertyKey[], expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
objectKeysIn<T>(actual: ExpectType<T>, keys: PropertyKey[], expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
objectSomeKeys<T>(actual: ExpectType<T>, keys: PropertyKey[], expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
positiveInfinity<T extends number>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
regExp<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
pending<T>(actual: T | PromiseLike<T>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
rejected<T>(actual: T | PromiseLike<T>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
rejectedWith<T, U>(actual: T | PromiseLike<T>, expected: jasmine.Expected<U>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
rejectedWithError<T, U>(actual: T | PromiseLike<T>, expected?: new (...args: any[]) => Error, message?: string | RegExp, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
resolved<T>(actual: T | PromiseLike<T>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
resolvedTo<T>(actual: T | PromiseLike<T>, expected: jasmine.Expected<T>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
string<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
stringIncludes<T>(actual: ExpectType<T>, includes: string[], expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
stringIncludesSome<T>(actual: ExpectType<T>, includes: string[], expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
stringOfLength<T, Length extends number>(actual: ExpectType<T>, length: Length, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
stringOfLengthBetween<T, Min extends number, Max extends number>(actual: ExpectType<T>, min: Min, max: Max, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
stringType<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
symbol<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
true<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
truthy<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
undefined<T>(actual: ExpectType<T>, expected?: jasmine.Expected<boolean>, expectation?: string, expectationFailOutput?: any, execute?: boolean): this;
}