encoding-ignored.js
This file
Path
test/transform/encoding-ignored.js
88 lines · 8.7 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 process from 'node:process';TweaksSindre Sorhusbefore adoption698a1b8
line 3why, one step back3import test from 'node:test';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 4–10why, one step back4import {execa, execaSync} from '../../index.js';5import {setFixtureDirectory} from '../helpers/fixtures-directory.js';6import {outputObjectGenerator, addNoopGenerator} from '../helpers/generator.js';7import {foobarObject} from '../helpers/input.js';89setFixtureDirectory();10TweaksSindre Sorhusbefore adoption698a1b8
line 11why, one step back11const testObjectMode = async (addNoopTransform, execaMethod) => {100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 12–15why, one step back12 const {stdout} = await execaMethod('noop.js', {13 stdout: addNoopGenerator(outputObjectGenerator(), addNoopTransform, true),14 encoding: 'base64',15 });TweaksSindre Sorhusbefore adoption698a1b8
line 16why, one step back16 assert.deepEqual(stdout, [foobarObject]);100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 17–18why, one step back17};18TweaksSindre Sorhusbefore adoption698a1b8
lines 19–22why, one step back19test('Other encodings work with transforms that return objects', () => testObjectMode(false, execa));20test('Other encodings work with transforms that return objects, noop transform', () => testObjectMode(true, execa));21test('Other encodings work with transforms that return objects, sync', () => testObjectMode(false, execaSync));22test('Other encodings work with transforms that return objects, noop transform, sync', () => testObjectMode(true, execaSync));100% test coverage (#1018)ehmickybefore adoption9f65b86
line 23why, one step back23TweaksSindre Sorhusbefore adoption698a1b8
line 24why, one step back24const testIgnoredEncoding = async (stdoutOption, isUndefined, options, execaMethod) => {100% test coverage (#1018)ehmickybefore adoption9f65b86
line 25why, one step back25 const {stdout} = await execaMethod('empty.js', {stdout: stdoutOption, ...options});TweaksSindre Sorhusbefore adoption698a1b8
line 26why, one step back26 assert.equal(stdout === undefined, isUndefined);100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 27–30why, one step back27};2829const base64Options = {encoding: 'base64'};30const linesOptions = {lines: true};TweaksSindre Sorhusbefore adoption698a1b8
lines 31–88why, one step back31test('Is ignored with other encodings and "ignore"', () => testIgnoredEncoding('ignore', true, base64Options, execa));32test('Is ignored with other encodings and ["ignore"]', () => testIgnoredEncoding(['ignore'], true, base64Options, execa));33test('Is ignored with other encodings and "inherit"', () => testIgnoredEncoding('inherit', true, base64Options, execa));34test('Is ignored with other encodings and ["inherit"]', () => testIgnoredEncoding(['inherit'], true, base64Options, execa));35test('Is ignored with other encodings and 1', () => testIgnoredEncoding(1, true, base64Options, execa));36test('Is ignored with other encodings and [1]', () => testIgnoredEncoding([1], true, base64Options, execa));37test('Is ignored with other encodings and process.stdout', () => testIgnoredEncoding(process.stdout, true, base64Options, execa));38test('Is ignored with other encodings and [process.stdout]', () => testIgnoredEncoding([process.stdout], true, base64Options, execa));39test('Is not ignored with other encodings and "pipe"', () => testIgnoredEncoding('pipe', false, base64Options, execa));40test('Is not ignored with other encodings and ["pipe"]', () => testIgnoredEncoding(['pipe'], false, base64Options, execa));41test('Is not ignored with other encodings and "overlapped"', () => testIgnoredEncoding('overlapped', false, base64Options, execa));42test('Is not ignored with other encodings and ["overlapped"]', () => testIgnoredEncoding(['overlapped'], false, base64Options, execa));43test('Is not ignored with other encodings and ["inherit", "pipe"]', () => testIgnoredEncoding(['inherit', 'pipe'], false, base64Options, execa));44test('Is not ignored with other encodings and undefined', () => testIgnoredEncoding(undefined, false, base64Options, execa));45test('Is not ignored with other encodings and null', () => testIgnoredEncoding(null, false, base64Options, execa));46test('Is ignored with "lines: true" and "ignore"', () => testIgnoredEncoding('ignore', true, linesOptions, execa));47test('Is ignored with "lines: true" and ["ignore"]', () => testIgnoredEncoding(['ignore'], true, linesOptions, execa));48test('Is ignored with "lines: true" and "inherit"', () => testIgnoredEncoding('inherit', true, linesOptions, execa));49test('Is ignored with "lines: true" and ["inherit"]', () => testIgnoredEncoding(['inherit'], true, linesOptions, execa));50test('Is ignored with "lines: true" and 1', () => testIgnoredEncoding(1, true, linesOptions, execa));51test('Is ignored with "lines: true" and [1]', () => testIgnoredEncoding([1], true, linesOptions, execa));52test('Is ignored with "lines: true" and process.stdout', () => testIgnoredEncoding(process.stdout, true, linesOptions, execa));53test('Is ignored with "lines: true" and [process.stdout]', () => testIgnoredEncoding([process.stdout], true, linesOptions, execa));54test('Is not ignored with "lines: true" and "pipe"', () => testIgnoredEncoding('pipe', false, linesOptions, execa));55test('Is not ignored with "lines: true" and ["pipe"]', () => testIgnoredEncoding(['pipe'], false, linesOptions, execa));56test('Is not ignored with "lines: true" and "overlapped"', () => testIgnoredEncoding('overlapped', false, linesOptions, execa));57test('Is not ignored with "lines: true" and ["overlapped"]', () => testIgnoredEncoding(['overlapped'], false, linesOptions, execa));58test('Is not ignored with "lines: true" and ["inherit", "pipe"]', () => testIgnoredEncoding(['inherit', 'pipe'], false, linesOptions, execa));59test('Is not ignored with "lines: true" and undefined', () => testIgnoredEncoding(undefined, false, linesOptions, execa));60test('Is not ignored with "lines: true" and null', () => testIgnoredEncoding(null, false, linesOptions, execa));61test('Is ignored with "lines: true", other encodings and "ignore"', () => testIgnoredEncoding('ignore', true, {...base64Options, ...linesOptions}, execa));62test('Is not ignored with "lines: true", other encodings and "pipe"', () => testIgnoredEncoding('pipe', false, {...base64Options, ...linesOptions}, execa));63test('Is ignored with other encodings and "ignore", sync', () => testIgnoredEncoding('ignore', true, base64Options, execaSync));64test('Is ignored with other encodings and ["ignore"], sync', () => testIgnoredEncoding(['ignore'], true, base64Options, execaSync));65test('Is ignored with other encodings and "inherit", sync', () => testIgnoredEncoding('inherit', true, base64Options, execaSync));66test('Is ignored with other encodings and ["inherit"], sync', () => testIgnoredEncoding(['inherit'], true, base64Options, execaSync));67test('Is ignored with other encodings and 1, sync', () => testIgnoredEncoding(1, true, base64Options, execaSync));68test('Is ignored with other encodings and [1], sync', () => testIgnoredEncoding([1], true, base64Options, execaSync));69test('Is ignored with other encodings and process.stdout, sync', () => testIgnoredEncoding(process.stdout, true, base64Options, execaSync));70test('Is ignored with other encodings and [process.stdout], sync', () => testIgnoredEncoding([process.stdout], true, base64Options, execaSync));71test('Is not ignored with other encodings and "pipe", sync', () => testIgnoredEncoding('pipe', false, base64Options, execaSync));72test('Is not ignored with other encodings and ["pipe"], sync', () => testIgnoredEncoding(['pipe'], false, base64Options, execaSync));73test('Is not ignored with other encodings and undefined, sync', () => testIgnoredEncoding(undefined, false, base64Options, execaSync));74test('Is not ignored with other encodings and null, sync', () => testIgnoredEncoding(null, false, base64Options, execaSync));75test('Is ignored with "lines: true" and "ignore", sync', () => testIgnoredEncoding('ignore', true, linesOptions, execaSync));76test('Is ignored with "lines: true" and ["ignore"], sync', () => testIgnoredEncoding(['ignore'], true, linesOptions, execaSync));77test('Is ignored with "lines: true" and "inherit", sync', () => testIgnoredEncoding('inherit', true, linesOptions, execaSync));78test('Is ignored with "lines: true" and ["inherit"], sync', () => testIgnoredEncoding(['inherit'], true, linesOptions, execaSync));79test('Is ignored with "lines: true" and 1, sync', () => testIgnoredEncoding(1, true, linesOptions, execaSync));80test('Is ignored with "lines: true" and [1], sync', () => testIgnoredEncoding([1], true, linesOptions, execaSync));81test('Is ignored with "lines: true" and process.stdout, sync', () => testIgnoredEncoding(process.stdout, true, linesOptions, execaSync));82test('Is ignored with "lines: true" and [process.stdout], sync', () => testIgnoredEncoding([process.stdout], true, linesOptions, execaSync));83test('Is not ignored with "lines: true" and "pipe", sync', () => testIgnoredEncoding('pipe', false, linesOptions, execaSync));84test('Is not ignored with "lines: true" and ["pipe"], sync', () => testIgnoredEncoding(['pipe'], false, linesOptions, execaSync));85test('Is not ignored with "lines: true" and undefined, sync', () => testIgnoredEncoding(undefined, false, linesOptions, execaSync));86test('Is not ignored with "lines: true" and null, sync', () => testIgnoredEncoding(null, false, linesOptions, execaSync));87test('Is ignored with "lines: true", other encodings and "ignore", sync', () => testIgnoredEncoding('ignore', true, {...base64Options, ...linesOptions}, execaSync));88test('Is not ignored with "lines: true", other encodings and "pipe", sync', () => testIgnoredEncoding('pipe', false, {...base64Options, ...linesOptions}, execaSync));