output-noop.js
This file
Path
test/verbose/output-noop.js
79 lines · 4.6 KiB · JavaScript
Last changed by
TweaksSindre Sorhusbefore adoption698a1b8
History of this fileTake it
The walk stopped after 200 commits: lines older than 9f65b86 point at it.
TweaksSindre Sorhusbefore adoption698a1b8
line 1why, one step back1import assert from 'node:assert/strict';100% test coverage (#1018)ehmickybefore adoption9f65b86
line 2why, one step back2import {rm, readFile} from 'node:fs/promises';TweaksSindre Sorhusbefore adoption698a1b8
line 3why, one step back3import test from 'node:test';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 4–6why, one step back4import tempfile from 'tempfile';5import {setFixtureDirectory} from '../helpers/fixtures-directory.js';6import {foobarString} from '../helpers/input.js';Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
line 7why, one step back7import {nestedSubprocess} from '../helpers/nested.js';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 8–11why, one step back8import {getOutputLine, testTimestamp} from '../helpers/verbose.js';910setFixtureDirectory();11TweaksSindre Sorhusbefore adoption698a1b8
line 12why, one step back12const testNoOutputOptions = async (isSync, options) => {Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
line 13why, one step back13 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose: 'full', isSync, ...options});TweaksSindre Sorhusbefore adoption698a1b8
line 14why, one step back14 assert.equal(getOutputLine(stderr), undefined);100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 15–16why, one step back15};16TweaksSindre Sorhusbefore adoption698a1b8
lines 17–28why, one step back17test('Does not print stdout, encoding "buffer"', () => testNoOutputOptions(false, {encoding: 'buffer'}));18test('Does not print stdout, encoding "hex"', () => testNoOutputOptions(false, {encoding: 'hex'}));19test('Does not print stdout, encoding "base64"', () => testNoOutputOptions(false, {encoding: 'base64'}));20test('Does not print stdout, stdout "ignore"', () => testNoOutputOptions(false, {stdout: 'ignore'}));21test('Does not print stdout, stdout "inherit"', () => testNoOutputOptions(false, {stdout: 'inherit'}));22test('Does not print stdout, stdout 1', () => testNoOutputOptions(false, {stdout: 1}));23test('Does not print stdout, encoding "buffer", sync', () => testNoOutputOptions(true, {encoding: 'buffer'}));24test('Does not print stdout, encoding "hex", sync', () => testNoOutputOptions(true, {encoding: 'hex'}));25test('Does not print stdout, encoding "base64", sync', () => testNoOutputOptions(true, {encoding: 'base64'}));26test('Does not print stdout, stdout "ignore", sync', () => testNoOutputOptions(true, {stdout: 'ignore'}));27test('Does not print stdout, stdout "inherit", sync', () => testNoOutputOptions(true, {stdout: 'inherit'}));28test('Does not print stdout, stdout 1, sync', () => testNoOutputOptions(true, {stdout: 1}));100% test coverage (#1018)ehmickybefore adoption9f65b86
line 29why, one step back29TweaksSindre Sorhusbefore adoption698a1b8
line 30why, one step back30const testNoOutputDynamic = async (isSync, optionsFixture) => {Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
line 31why, one step back31 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose: 'full', isSync, optionsFixture});TweaksSindre Sorhusbefore adoption698a1b8
line 32why, one step back32 assert.equal(getOutputLine(stderr), undefined);Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
lines 33–34why, one step back33};34TweaksSindre Sorhusbefore adoption698a1b8
lines 35–38why, one step back35test('Does not print stdout, stdout Writable', () => testNoOutputDynamic(false, 'writable.js'));36test('Does not print stdout, stdout WritableStream', () => testNoOutputDynamic(false, 'writable-web.js'));37test('Does not print stdout, stdout Writable, sync', () => testNoOutputDynamic(true, 'writable.js'));38test('Does not print stdout, stdout WritableStream, sync', () => testNoOutputDynamic(true, 'writable-web.js'));Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
line 39why, one step back39TweaksSindre Sorhusbefore adoption698a1b8
line 40why, one step back40const testNoOutputStream = async parentFixture => {Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
line 41why, one step back41 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose: 'full', parentFixture});TweaksSindre Sorhusbefore adoption698a1b8
line 42why, one step back42 assert.equal(getOutputLine(stderr), undefined);Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
lines 43–44why, one step back43};44TweaksSindre Sorhusbefore adoption698a1b8
lines 45–47why, one step back45test('Does not print stdout, .pipe(stream)', () => testNoOutputStream('nested-pipe-stream.js'));46test('Does not print stdout, .pipe(subprocess)', () => testNoOutputStream('nested-pipe-subprocess.js'));47test('Does not print stdout, subprocess.all.pipe(stream)', () => testNoOutputStream('nested-pipe-all-stream.js'));Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
line 48why, one step back48TweaksSindre Sorhusbefore adoption698a1b8
line 49why, one step back49const testStdoutFile = async (isSync, optionsFixture) => {100% test coverage (#1018)ehmickybefore adoption9f65b86
line 50why, one step back50 const file = tempfile();Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
lines 51–56why, one step back51 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {52 verbose: 'full',53 stdout: {file},54 isSync,55 optionsFixture,56 });TweaksSindre Sorhusbefore adoption698a1b8
line 57why, one step back57 assert.equal(getOutputLine(stderr), undefined);100% test coverage (#1018)ehmickybefore adoption9f65b86
line 58why, one step back58 const contents = await readFile(file, 'utf8');TweaksSindre Sorhusbefore adoption698a1b8
line 59why, one step back59 assert.equal(contents.trim(), foobarString);100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 60–62why, one step back60 await rm(file);61};62TweaksSindre Sorhusbefore adoption698a1b8
lines 63–66why, one step back63test('Does not print stdout, stdout { file }', () => testStdoutFile(false));64test('Does not print stdout, stdout fileUrl', () => testStdoutFile(false, 'file-url.js'));65test('Does not print stdout, stdout { file }, sync', () => testStdoutFile(true));66test('Does not print stdout, stdout fileUrl, sync', () => testStdoutFile(true, 'file-url.js'));100% test coverage (#1018)ehmickybefore adoption9f65b86
line 67why, one step back67TweaksSindre Sorhusbefore adoption698a1b8
line 68why, one step back68const testPrintOutputOptions = async (options, isSync) => {Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
line 69why, one step back69 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose: 'full', isSync, ...options});TweaksSindre Sorhusbefore adoption698a1b8
line 70why, one step back70 assert.equal(getOutputLine(stderr), `${testTimestamp} [0] ${foobarString}`);100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 71–72why, one step back71};72TweaksSindre Sorhusbefore adoption698a1b8
lines 73–79why, one step back73test('Prints stdout, stdout "pipe"', () => testPrintOutputOptions({stdout: 'pipe'}, false));74test('Prints stdout, stdout "overlapped"', () => testPrintOutputOptions({stdout: 'overlapped'}, false));75test('Prints stdout, stdout null', () => testPrintOutputOptions({stdout: null}, false));76test('Prints stdout, stdout ["pipe"]', () => testPrintOutputOptions({stdout: ['pipe']}, false));77test('Prints stdout, stdout "pipe", sync', () => testPrintOutputOptions({stdout: 'pipe'}, true));78test('Prints stdout, stdout null, sync', () => testPrintOutputOptions({stdout: null}, true));79test('Prints stdout, stdout ["pipe"], sync', () => testPrintOutputOptions({stdout: ['pipe']}, true));