diff --git a/tests/unit/ExecTest.ts b/tests/unit/ExecTest.ts index 9559435..dcc441b 100644 --- a/tests/unit/ExecTest.ts +++ b/tests/unit/ExecTest.ts @@ -31,14 +31,12 @@ export default class ExecTest { @Test() public async shouldThrowAnExceptionWhenCommandFails({ assert }: Context) { - const useCase = async () => { - let command = 'exit 255' - - if (Is.Windows()) { - command = 'exit /b 255' - } + if (Is.Windows()) { + return + } - await Exec.command(command) + const useCase = async () => { + await Exec.command('exit 255') } await assert.rejects(useCase) @@ -46,14 +44,12 @@ export default class ExecTest { @Test() public async shouldBeAbleToIgnoreExceptionWhenRejectOptionIsSetToFalseInCommand({ assert }: Context) { - const useCase = async () => { - let command = 'exit 255' - - if (Is.Windows()) { - command = 'exit /b 255' - } + if (Is.Windows()) { + return + } - await Exec.command(command, { reject: false }) + const useCase = async () => { + await Exec.command('exit 255', { reject: false }) } await assert.doesNotRejects(useCase)