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 |
|
9 | type StubFunction = (...params: any[]) => any;
|
10 | type Stub = object | StubFunction;
|
11 |
|
12 | interface Mock {
|
13 | (path: string, mockExport: string | Stub): void;
|
14 | stop(path: string): void;
|
15 | stopAll(): void;
|
16 | reRequire(path: string): any;
|
17 | }
|
18 |
|
19 | declare var mock: Mock;
|
20 |
|
21 | export = mock;
|