From f968c816cc7b6d5f294e0770e88a5ce7fbc3df5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Sun, 24 Sep 2023 13:47:46 +0100 Subject: [PATCH] test(windows): dont run exit tests on windows --- tests/unit/ExecTest.ts | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) 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)