From b8758cc43dca5209977f3cfc75d788511e99e236 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Thu, 4 Jul 2019 10:00:00 +0200 Subject: [PATCH] Fix test for Node `>= 12.6.0` --- test/test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index 4f0519a891..52fcaf0a26 100644 --- a/test/test.js +++ b/test/test.js @@ -157,7 +157,9 @@ if (process.platform !== 'win32') { }); test('execa() rejects with correct error and doesn\'t throw if running non-executable with input', async t => { - await t.throwsAsync(execa('non-executable', {input: 'Hey!'}), /EACCES/); + // On Node <12.6.0, `EACCESS` is emitted on `childProcess`. + // On Node >=12.6.0, `EPIPE` is emitted on `childProcess.stdin`. + await t.throwsAsync(execa('non-executable', {input: 'Hey!'}), /EACCES|EPIPE/); }); }