import { DeepPartial } from '../../types/util'; import type sinon from 'sinon'; import 'should'; /** * Asserts that a stub or apy called specified number of times with args matched specified ones * @param {Function} spy Sinon stub or spy * @param {Number} calls Expected number of calls * @param {Array} args Expected call arguments * @throws {AssertionError} If assertion failed */ export declare function callCountWithMatch(spy: Spy, calls: number, ...args: DeepPartial>): void; /** * Asserts that a stub or apy called specified number of times with args that deep equal to specified ones * @param {Function} spy Sinon stub or spy * @param {Number} calls Expected number of calls * @param {Array} args Expected call arguments * @throws {AssertionError} If assertion failed */ export declare function callCountWithExactly(spy: Spy, calls: number, ...args: Parameters): void; /** * Asserts that array matches to expected one with and the lengths are equal * @param {Array} actualArray Actual array to match * @param {Array} expectedArray Expected array to match to * @throws {AssertionError} If assertion failed */ export declare function arrayMatchWithEqualLength(actualArray: any, expectedArray: any): void; /** Spy call options */ export type SpyCall = { /** Sinon spy */ spy: sinon.SinonSpy; /** Call index */ call: number; /** If specified, asserts args match */ matchArgs?: DeepPartial; /** Logging label. Defaults to `spy` function name, which defaults to `default` */ label?: string; }; /** * Sinon's callOrder seems to have some bug giving incorrect assertion, so this is a manual implementation * @param spyCalls spy calls * @throws assertion error */ export declare function callOrder(spyCalls: SpyCall[]): void;