UNPKG

ngx-testing-tools

Version:
44 lines (43 loc) 1.82 kB
import { Type } from '@angular/core'; import { GuardTestBed, GuardTestBedOptions } from './models'; import { GuardCan, GuardClass, GuardFn } from './models/guard-can.model'; /** * Creates a new `GuardTestBed` to configure the custom test bed and wrap the assertion test. * @param rootGuard - the described class guard * @param options - check `GuardTestBedOptions` */ export declare function guardTestBed<T extends GuardClass>(rootGuard: Type<T>, options?: GuardTestBedOptions & { type?: GuardCan; }): GuardTestBed<T>; /** * Creates a new `GuardTestBed` to configure the custom test bed and wrap the assertion test. * @param rootGuard - the described function guard * @param options - check `GuardTestBedOptions` */ export declare function guardTestBed<T extends GuardFn>(rootGuard: T, options: GuardTestBedOptions & { type: GuardCan; }): GuardTestBed<T>; /** * Only invokes the "should create" test. * * To be used when there are no noticeable or relevant tests to be performed on this guard. * * The usage of this function and `guardTestBed` function must be mutually exclusive. * * @param rootGuard - the described guard * @param options */ export declare function itShouldCreateGuard<T extends GuardClass>(rootGuard: Type<T>, options?: ItShouldCreateGuardOptions): void; /** * Only invokes the "should create" test. * * To be used when there are no noticeable or relevant tests to be performed on this guard. * * The usage of this function and `guardTestBed` function must be mutually exclusive. * * @param rootGuard - the described guard * @param options */ export declare function itShouldCreateGuard<T extends GuardFn>(rootGuard: T, options?: ItShouldCreateGuardOptions): void; type ItShouldCreateGuardOptions = Pick<GuardTestBedOptions, 'providers' | 'imports'>; export {};