output-mixed.js
This file
Path
test/verbose/output-mixed.js
86 lines · 3.5 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 {inspect} from 'node:util';TweaksSindre Sorhusbefore adoption698a1b8
line 3why, one step back3import test from 'node:test';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 4–6why, one step back4import {setFixtureDirectory} from '../helpers/fixtures-directory.js';5import {foobarString, foobarObject} from '../helpers/input.js';6import {simpleFull, noNewlinesChunks} from '../helpers/lines.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, getOutputLines, testTimestamp} from '../helpers/verbose.js';910setFixtureDirectory();11TweaksSindre Sorhusbefore adoption698a1b8
line 12why, one step back12const testLines = async (lines, stripFinalNewline, isSync) => {Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
lines 13–18why, one step back13 const {stderr} = await nestedSubprocess('noop-fd.js', ['1', simpleFull], {14 verbose: 'full',15 lines,16 stripFinalNewline,17 isSync,18 });TweaksSindre Sorhusbefore adoption698a1b8
line 19why, one step back19 assert.deepEqual(getOutputLines(stderr), noNewlinesChunks.map(line => `${testTimestamp} [0] ${line}`));100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 20–21why, one step back20};21TweaksSindre Sorhusbefore adoption698a1b8
lines 22–27why, one step back22test('Prints stdout, "lines: true"', () => testLines(true, false, false));23test('Prints stdout, "lines: true", fd-specific', () => testLines({stdout: true}, false, false));24test('Prints stdout, "lines: true", stripFinalNewline', () => testLines(true, true, false));25test('Prints stdout, "lines: true", sync', () => testLines(true, false, true));26test('Prints stdout, "lines: true", fd-specific, sync', () => testLines({stdout: true}, false, true));27test('Prints stdout, "lines: true", stripFinalNewline, sync', () => testLines(true, true, true));100% test coverage (#1018)ehmickybefore adoption9f65b86
line 28why, one step back28TweaksSindre Sorhusbefore adoption698a1b8
line 29why, one step back29const testOnlyTransforms = async isSync => {Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
lines 30–34why, one step back30 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {31 optionsFixture: 'generator-uppercase.js',32 verbose: 'full',33 isSync,34 });TweaksSindre Sorhusbefore adoption698a1b8
line 35why, one step back35 assert.equal(getOutputLine(stderr), `${testTimestamp} [0] ${foobarString.toUpperCase()}`);100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 36–37why, one step back36};37TweaksSindre Sorhusbefore adoption698a1b8
lines 38–39why, one step back38test('Prints stdout with only transforms', () => testOnlyTransforms(false));39test('Prints stdout with only transforms, sync', () => testOnlyTransforms(true));100% test coverage (#1018)ehmickybefore adoption9f65b86
line 40why, one step back40TweaksSindre Sorhusbefore adoption698a1b8
line 41why, one step back41test('Prints stdout with only duplexes', async () => {Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
lines 42–45why, one step back42 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {43 optionsFixture: 'generator-duplex.js',44 verbose: 'full',45 });TweaksSindre Sorhusbefore adoption698a1b8
line 46why, one step back46 assert.equal(getOutputLine(stderr), `${testTimestamp} [0] ${foobarString.toUpperCase()}`);Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
lines 47–48why, one step back47});48TweaksSindre Sorhusbefore adoption698a1b8
line 49why, one step back49const testObjectMode = async isSync => {Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
lines 50–54why, one step back50 const {stderr} = await nestedSubprocess('noop.js', {51 optionsFixture: 'generator-object.js',52 verbose: 'full',53 isSync,54 });TweaksSindre Sorhusbefore adoption698a1b8
line 55why, one step back55 assert.equal(getOutputLine(stderr), `${testTimestamp} [0] ${inspect(foobarObject)}`);100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 56–57why, one step back56};57TweaksSindre Sorhusbefore adoption698a1b8
lines 58–59why, one step back58test('Prints stdout with object transforms', () => testObjectMode(false));59test('Prints stdout with object transforms, sync', () => testObjectMode(true));100% test coverage (#1018)ehmickybefore adoption9f65b86
line 60why, one step back60TweaksSindre Sorhusbefore adoption698a1b8
line 61why, one step back61const testBigArray = async isSync => {Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
lines 62–66why, one step back62 const {stderr} = await nestedSubprocess('noop.js', {63 optionsFixture: 'generator-big-array.js',64 verbose: 'full',65 isSync,66 });100% test coverage (#1018)ehmickybefore adoption9f65b86
line 67why, one step back67 const lines = getOutputLines(stderr);TweaksSindre Sorhusbefore adoption698a1b8
lines 68–70why, one step back68 assert.equal(lines[0], `${testTimestamp} [0] [`);69 assert.ok(lines[1].startsWith(`${testTimestamp} [0] 0, 1,`));70 assert.equal(lines.at(-1), `${testTimestamp} [0] ]`);100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 71–72why, one step back71};72TweaksSindre Sorhusbefore adoption698a1b8
lines 73–74why, one step back73test('Prints stdout with big object transforms', () => testBigArray(false));74test('Prints stdout with big object transforms, sync', () => testBigArray(true));100% test coverage (#1018)ehmickybefore adoption9f65b86
line 75why, one step back75TweaksSindre Sorhusbefore adoption698a1b8
line 76why, one step back76const testObjectModeString = async isSync => {Refactor test helpers for the `verbose` option (#1128)ehmickybefore adoption18d320f
lines 77–81why, one step back77 const {stderr} = await nestedSubprocess('noop.js', {78 optionsFixture: 'generator-string-object.js',79 verbose: 'full',80 isSync,81 });TweaksSindre Sorhusbefore adoption698a1b8
line 82why, one step back82 assert.deepEqual(getOutputLines(stderr), noNewlinesChunks.map(line => `${testTimestamp} [0] ${line}`));100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 83–84why, one step back83};84TweaksSindre Sorhusbefore adoption698a1b8
lines 85–86why, one step back85test('Prints stdout with string transforms in objectMode', () => testObjectModeString(false));86test('Prints stdout with string transforms in objectMode, sync', () => testObjectModeString(true));