Skip to content

Commit

Permalink
test(windows): dont run exit tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Sep 24, 2023
1 parent 7e66b20 commit f968c81
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions tests/unit/ExecTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,25 @@ 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)
}

@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)
Expand Down

0 comments on commit f968c81

Please sign in to comment.