Skip to content
Myr

input-sync.js

This file

Path

test/stdio/input-sync.js

18 lines · 696 bytes · JavaScript

Last changed by

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

History of this file

Take it

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 1–18why, one step back
1import test from 'ava';
2import {execaSync} from '../../index.js';3import {setFixtureDir} from '../helpers/fixtures-dir.js';4import {getStdio} from '../helpers/stdio.js';56setFixtureDir();78const getFd3InputMessage = type => `not \`stdio[3]\`, can be ${type}`;910const testFd3InputSync = (t, stdioOption, expectedMessage) => {11 const {message} = t.throws(() => {12 execaSync('empty.js', getStdio(3, stdioOption));13 });14 t.true(message.includes(expectedMessage));15};1617test('Cannot use Uint8Array with stdio[*], sync', testFd3InputSync, new Uint8Array(), getFd3InputMessage('a Uint8Array'));18test('Cannot use iterable with stdio[*], sync', testFd3InputSync, [[]], getFd3InputMessage('an iterable'));