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
12345678910111213141516171819202122import { Command } from '../index.js';
/** * Create a Command configured for using in tests. * * Throws exceptions instead of calling process.exit (.exitOverride()) * and output suppressed. * * @returns Command */
export function createTestCommand() { const cmd = new Command(); cmd .exitOverride() // So we get exceptions instead of process.exit .configureOutput({ writeOut: () => {}, writeErr: () => {}, }); return cmd;}