From 0bd1f2c2e9240034ddcca120f5d7e5f360d1dd3b Mon Sep 17 00:00:00 2001 From: ehmicky Date: Thu, 30 May 2019 10:00:00 +0200 Subject: [PATCH] Fix tests on Windows --- test.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test.js b/test.js index 8938a35a16..ebe1a37965 100644 --- a/test.js +++ b/test.js @@ -65,15 +65,11 @@ test('stdout/stderr/all are undefined if ignored in sync mode', t => { t.is(all, undefined); }); -const WRONG_COMMAND_STDERR = process.platform === 'win32' ? - '\'wrong\' is not recognized as an internal or external command,\r\noperable program or batch file.' : - ''; - test('stdout/stderr/all on process errors', async t => { const {stdout, stderr, all} = await t.throwsAsync(execa('wrong command')); t.is(stdout, ''); - t.is(stderr, WRONG_COMMAND_STDERR); - t.is(all, WRONG_COMMAND_STDERR); + t.is(stderr, ''); + t.is(all, ''); }); test('stdout/stderr/all on process errors, in sync mode', t => { @@ -81,7 +77,9 @@ test('stdout/stderr/all on process errors, in sync mode', t => { execa.sync('wrong command'); }); t.is(stdout, ''); - t.is(stderr, WRONG_COMMAND_STDERR); + t.is(stderr, process.platform === 'win32' ? + '\'wrong\' is not recognized as an internal or external command,\r\noperable program or batch file.' : + ''); t.is(all, undefined); });