input-sync.js
This file
Path
test/io/input-sync.js
18 lines · 714 bytes · JavaScript
Last changed by
Upgrade xo (#980)ehmickybefore adoptionccfa412
History of this fileTake it
12345678910111213141516171819import test from 'ava';import {execaSync} from '../../index.js';import {setFixtureDirectory} from '../helpers/fixtures-directory.js';import {getStdio} from '../helpers/stdio.js';
setFixtureDirectory();
const getFd3InputMessage = type => `not \`stdio[3]\`, can be ${type}`;
const testFd3InputSync = (t, stdioOption, expectedMessage) => { const {message} = t.throws(() => { execaSync('empty.js', getStdio(3, stdioOption)); }); t.true(message.includes(expectedMessage));};
test('Cannot use Uint8Array with stdio[*], sync', testFd3InputSync, new Uint8Array(), getFd3InputMessage('a Uint8Array'));test('Cannot use iterable with stdio[*], sync', testFd3InputSync, [[]], getFd3InputMessage('an iterable'));