(t, opts)
| 19 | }) |
| 20 | |
| 21 | const mockExplain = async (t, opts) => { |
| 22 | const mock = await mockNpm(t, { |
| 23 | command: 'explain', |
| 24 | mocks: { |
| 25 | // keep the snapshots pared down a bit, since this has its own tests. |
| 26 | '{LIB}/utils/explain-dep.js': { |
| 27 | explainNode: (expl, depth, chalk) => { |
| 28 | const color = chalk.level !== 0 |
| 29 | return `${expl.name}@${expl.version} depth=${depth} color=${color}` |
| 30 | }, |
| 31 | }, |
| 32 | }, |
| 33 | ...opts, |
| 34 | }) |
| 35 | |
| 36 | return mock |
| 37 | } |
| 38 | |
| 39 | t.test('no args throws usage', async t => { |
| 40 | const { explain } = await mockExplain(t) |
no test coverage detected
searching dependent graphs…