UNPKG

590 BTypeScriptView Raw
1// Type definitions for mock-require 2.0
2// Project: https://github.com/boblauer/mock-require
3// Definitions by: Giorgio Delgado <https://github.com/gDelgado14>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5// TypeScript Version: 2.4
6
7/// <reference types="node" />
8
9type StubFunction = (...params: any[]) => any;
10type Stub = object | StubFunction;
11
12interface Mock {
13 (path: string, mockExport: string | Stub): void;
14 stop(path: string): void;
15 stopAll(): void;
16 reRequire(path: string): any;
17}
18
19declare var mock: Mock;
20
21export = mock;