@o3r/testing
Version:
The module provides testing (e2e, unit test) utilities to help you build your own E2E pipeline integrating visual testing.
35 lines • 1.38 kB
TypeScript
import { Observable } from 'rxjs';
import { FakeSelectCall, SelectorFunction } from './typings';
export * from '@ngrx/store';
/**
*
* PUBLIC METHODS
*
*/
/**
* Clears all the registered selector spies
*/
export declare function clearSelectorSpies(): void;
/**
* Initialize the selector spies structure
*/
export declare function initializeSelectorSpies(): void;
/**
* Spy on a selector function
* @param selector Selector function to be spied on
* @param fakeResult The fake result to be used when a select is triggered
*/
export declare function spyOnSelector<R, S extends object = object>(selector: SelectorFunction<S, R>, fakeResult: R | FakeSelectCall<R>): void;
/**
* Removes the spy on a given selector function
* @param selector Selector function that is being spied on
*/
export declare function clearSelectorSpy<R, S extends object = object>(selector: SelectorFunction<S, R>): void;
/**
* Highjacked ngrx/store select. It checks if the selector function is being spied on
* and returns it's fake result. Otherwise, it runs the original ngrx/store select
* @param selectFn Selector function to be used
* @param props optional properties to be used by the selector
*/
export declare function select(selectFn: SelectorFunction<object, any>, props?: object): (source$: Observable<object>) => Observable<any>;
//# sourceMappingURL=testable-select.d.ts.map