(t, reify, { command, ...config } = {})
| 5 | t.cleanSnapshot = str => str.replace(/in [0-9]+m?s/g, 'in {TIME}') |
| 6 | |
| 7 | const mockReify = async (t, reify, { command, ...config } = {}) => { |
| 8 | const mock = await mockNpm(t, { |
| 9 | command, |
| 10 | config, |
| 11 | }) |
| 12 | |
| 13 | // Hack to adapt existing fake test. Make npm.command |
| 14 | // return whatever was passed in to this function. |
| 15 | // What it should be doing is npm.exec(command) but that |
| 16 | // breaks most of these tests because they don't expect |
| 17 | // a command to actually run. |
| 18 | Object.defineProperty(mock.npm, 'command', { |
| 19 | get () { |
| 20 | return command |
| 21 | }, |
| 22 | enumerable: true, |
| 23 | }) |
| 24 | |
| 25 | reifyOutput(mock.npm, reify) |
| 26 | mock.npm.finish() |
| 27 | |
| 28 | return mock.joinedOutput() |
| 29 | } |
| 30 | |
| 31 | t.test('missing info', async t => { |
| 32 | const out = await mockReify(t, { |
no test coverage detected
searching dependent graphs…