From 85dd4729ddf3d4feb558d2575178b2ee72098b74 Mon Sep 17 00:00:00 2001 From: Murph Murphy Date: Wed, 6 Dec 2023 23:48:30 -0700 Subject: [PATCH] test: make a test more forgiving for systems with non-standard bash and sh paths (#1144) Made a test more forgiving so it passes on systems that have non-standard `bash` and `sh` binary paths. --- test/exec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/exec.js b/test/exec.js index 9c9d9e71..cc7d3582 100644 --- a/test/exec.js +++ b/test/exec.js @@ -178,10 +178,10 @@ test('set shell option (TODO: add tests for Windows)', t => { t.is(result.stdout, '/bin/sh\n'); // sh by default const bashPath = shell.which('bash').trim(); if (bashPath) { - result = shell.exec('echo $0', { shell: '/bin/bash' }); + result = shell.exec('echo $0', { shell: bashPath }); t.falsy(shell.error()); t.is(result.code, 0); - t.is(result.stdout, '/bin/bash\n'); + t.is(result.stdout, `${bashPath}\n`); } }); });