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.
This commit is contained in:
Murph Murphy 2023-12-06 23:48:30 -07:00 committed by GitHub
parent 78ed036573
commit 85dd4729dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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`);
}
});
});