diff --git a/test/stream.js b/test/stream.js index 80c73d5a6b..98ea93cba6 100644 --- a/test/stream.js +++ b/test/stream.js @@ -171,6 +171,11 @@ test('input option can be a String', async t => { t.is(stdout, 'foobar'); }); +test('input option can be a Uint8Array', async t => { + const {stdout} = await execa('stdin.js', {input: Uint8Array.from('foo', c => c.codePointAt(0))}); + t.is(stdout, 'foo'); +}); + test('input option can be a Buffer', async t => { const {stdout} = await execa('stdin.js', {input: Buffer.from('testing12')}); t.is(stdout, 'testing12'); @@ -226,6 +231,11 @@ test('input option can be used with $.sync', t => { t.is(stdout, 'foobar'); }); +test('input option can be a Uint8Array - sync', t => { + const {stdout} = execaSync('stdin.js', {input: Uint8Array.from('foo', c => c.codePointAt(0))}); + t.is(stdout, 'foo'); +}); + test('input option can be a Buffer - sync', t => { const {stdout} = execaSync('stdin.js', {input: Buffer.from('testing12', 'utf8')}); t.is(stdout, 'testing12');