testHelpers.js
This file
Path
tests/testHelpers.js
21 lines · 463 bytes · JavaScript
Last changed by
Switching to esm-only (#2464)John Geebefore adoptionf4bd470
History of this fileTake it
Switching to esm-only (#2464)John Geebefore adoptionf4bd470
line 1why, one step back1import { Command } from '../index.js';Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
lines 2–11why, one step back23/**4 * Create a Command configured for using in tests.5 *6 * Throws exceptions instead of calling process.exit (.exitOverride())7 * and output suppressed.8 *9 * @returns Command10 */11Switching to esm-only (#2464)John Geebefore adoptionf4bd470
line 12why, one step back12export function createTestCommand() {Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
lines 13–21why, one step back13 const cmd = new Command();14 cmd15 .exitOverride() // So we get exceptions instead of process.exit16 .configureOutput({17 writeOut: () => {},18 writeErr: () => {},19 });20 return cmd;21}