ngx-testing-tools
Version:
Makes Angular testing easier
35 lines (34 loc) • 1.53 kB
TypeScript
import { Type } from '@angular/core';
import { Resolve, ResolveFn } from '@angular/router';
import { ResolverTestBed, ResolverTestBedOptions } from './models';
import { ValidResolver } from './models/valid-resolver.model';
/**
* Creates a new `ResolverTestBed` to configure the custom test bed and wrap the assertion test.
* @param resolver - the described resolver
* @param options - check `ResolverTestBedOptions`
*/
export declare function resolverTestBed<T>(resolver: ValidResolver<T>, options?: ResolverTestBedOptions): ResolverTestBed<T>;
/**
* Only invokes the "should create" test.
*
* To be used when there are no noticeable or relevant tests to be performed on this resolver.
*
* The usage of this function and `resolverTestBed` function must be mutually exclusive.
*
* @param resolver - the described resolver
* @param options
*/
export declare function itShouldCreateResolver<T extends Resolve<any>>(resolver: 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 resolver.
*
* The usage of this function and `resolverTestBed` function must be mutually exclusive.
*
* @param resolverFn - the described resolver
* @param options
*/
export declare function itShouldCreateResolver<T extends ResolveFn<any>>(resolverFn: T, options?: ItShouldCreateGuardOptions): void;
type ItShouldCreateGuardOptions = Pick<ResolverTestBedOptions, 'providers' | 'imports'>;
export {};