mirror of
https://github.com/toddbluhm/env-cmd.git
synced 2025-12-08 18:23:33 +00:00
fix: add an unreachable return, to test signal termination
This commit is contained in:
parent
bc94223674
commit
33b3367cff
@ -94,6 +94,7 @@ export class TermSignals {
|
||||
}
|
||||
if (code !== undefined) {
|
||||
process.exit(code)
|
||||
return // eslint-disable-line no-unreachable
|
||||
}
|
||||
throw new Error('Unable to terminate parent process successfully')
|
||||
}
|
||||
|
||||
@ -71,6 +71,7 @@ describe('signal-termination', (): void => {
|
||||
|
||||
it('should call exit method on parent process if no signal provided', (): void => {
|
||||
term._terminateProcess(0)
|
||||
// We here test code that in reality is unreachable.
|
||||
assert.equal(exitStub.callCount, 1)
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user