custom-id.js
This file
Path
test/verbose/custom-id.js
36 lines · 2.8 KiB · JavaScript
Last changed by
TweaksSindre Sorhusbefore adoption698a1b8
History of this fileTake it
TweaksSindre Sorhusbefore adoption698a1b8
lines 1–2why, one step back1import assert from 'node:assert/strict';2import test from 'node:test';Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
lines 3–7why, one step back3import {setFixtureDirectory} from '../helpers/fixtures-directory.js';4import {QUOTE, runVerboseSubprocess} from '../helpers/verbose.js';56setFixtureDirectory();7TweaksSindre Sorhusbefore adoption698a1b8
line 8why, one step back8const testVerboseCommandId = async (type, isSync) => {Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
line 9why, one step back9 const {stderr} = await runVerboseSubprocess({isSync, type, eventProperty: 'commandId'});TweaksSindre Sorhusbefore adoption698a1b8
line 10why, one step back10 assert.equal(stderr, '0');Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
lines 11–12why, one step back11};12TweaksSindre Sorhusbefore adoption698a1b8
lines 13–21why, one step back13test('"verbose" function receives verboseObject.commandId, "command"', () => testVerboseCommandId('command', false));14test('"verbose" function receives verboseObject.commandId, "output"', () => testVerboseCommandId('output', false));15test('"verbose" function receives verboseObject.commandId, "ipc"', () => testVerboseCommandId('ipc', false));16test('"verbose" function receives verboseObject.commandId, "error"', () => testVerboseCommandId('error', false));17test('"verbose" function receives verboseObject.commandId, "duration"', () => testVerboseCommandId('duration', false));18test('"verbose" function receives verboseObject.commandId, "command", sync', () => testVerboseCommandId('command', true));19test('"verbose" function receives verboseObject.commandId, "output", sync', () => testVerboseCommandId('output', true));20test('"verbose" function receives verboseObject.commandId, "error", sync', () => testVerboseCommandId('error', true));21test('"verbose" function receives verboseObject.commandId, "duration", sync', () => testVerboseCommandId('duration', true));Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
line 22why, one step back22TweaksSindre Sorhusbefore adoption698a1b8
line 23why, one step back23const testVerboseEscapedCommand = async (type, isSync) => {Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
line 24why, one step back24 const {stderr} = await runVerboseSubprocess({isSync, type, eventProperty: 'escapedCommand'});TweaksSindre Sorhusbefore adoption698a1b8
line 25why, one step back25 assert.equal(stderr, `noop-verbose.js ${QUOTE}. .${QUOTE}`);Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
lines 26–27why, one step back26};27TweaksSindre Sorhusbefore adoption698a1b8
lines 28–36why, one step back28test('"verbose" function receives verboseObject.escapedCommand, "command"', () => testVerboseEscapedCommand('command', false));29test('"verbose" function receives verboseObject.escapedCommand, "output"', () => testVerboseEscapedCommand('output', false));30test('"verbose" function receives verboseObject.escapedCommand, "ipc"', () => testVerboseEscapedCommand('ipc', false));31test('"verbose" function receives verboseObject.escapedCommand, "error"', () => testVerboseEscapedCommand('error', false));32test('"verbose" function receives verboseObject.escapedCommand, "duration"', () => testVerboseEscapedCommand('duration', false));33test('"verbose" function receives verboseObject.escapedCommand, "command", sync', () => testVerboseEscapedCommand('command', true));34test('"verbose" function receives verboseObject.escapedCommand, "output", sync', () => testVerboseEscapedCommand('output', true));35test('"verbose" function receives verboseObject.escapedCommand, "error", sync', () => testVerboseEscapedCommand('error', true));36test('"verbose" function receives verboseObject.escapedCommand, "duration", sync', () => testVerboseEscapedCommand('duration', true));