(...args: Array<any>)
| 5 | export function withConsole(props: Array<ConsoleProps>, fn: Function): void |
| 6 | |
| 7 | export function withConsole(...args: Array<any>): void { |
| 8 | let settings |
| 9 | let fn |
| 10 | if (typeof args[0] === "function") { |
| 11 | fn = args[0] |
| 12 | } else if (Array.isArray(args[0]) || typeof args[0] === "object") { |
| 13 | settings = args[0] |
| 14 | |
| 15 | if (typeof args[1] === "function") { |
| 16 | fn = args[1] |
| 17 | } |
| 18 | } |
| 19 | const restoreConsole = mockConsole(settings) |
| 20 | fn && fn() |
| 21 | restoreConsole() |
| 22 | } |
no test coverage detected
searching dependent graphs…