UNPKG

piumino

Version:

Piumino, meaning duvet in Italian, is like a duvet over the bed called Angular TestBed. It provides test helpers to test trivial things like inputs and outputs with a single line.

36 lines (35 loc) 1.45 kB
import { BaseMatcher } from "./matchers/base.matcher"; import { ComponentFixtureLike, GenericFunction, GenericObject, MatcherChainStarter, Selector } from "./types"; export declare class Piumino { private fixture; /** * Initialize Piumino. * * @param fixture - The TestBed fixture to use for all expects. */ init(fixture: ComponentFixtureLike): void; /** * Select an element that is a child of the fixture's component to expect something on. * * @param selector - The CSS selector to find the element. */ expect(selector: Selector): MatcherChainStarter<BaseMatcher>; /** * Replace a function implementation on the provided object with the provided implementation. * * @param obj - The object to replace the function on. * @param func - The name of the function to replace. * @param implementation - The implementation to replace the function with. */ replaceFunction(obj: GenericObject, func: string, implementation: GenericFunction): void; /** * Restore a function implementation on the provided object with the original implementation.\ * NOTE: Does nothing if the function was never replaced. * * @param obj - The object to restore the function on. * @param func - The name of the function to restore. */ restoreFunction(obj: GenericObject, func: string): void; private getFixture; private getErrorStack; }