Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
test: Add test case for CLI exit code regression
Browse files Browse the repository at this point in the history
  • Loading branch information
michalholasek committed Aug 9, 2017
1 parent 003eeca commit c2e9b80
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/integration/cli/server-process-cli-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@ describe 'CLI - Server Process', ->
it 'should exit with status 0', ->
assert.equal dreddCommandInfo.exitStatus, 0

describe 'When it fails to start', ->
dreddCommandInfo = undefined
args = [
'./test/fixtures/single-get.apib'
"http://127.0.0.1:#{DEFAULT_SERVER_PORT}"
"--server=/foo/bar/baz"
'--server-wait=1'
]

beforeEach (done) ->
runDreddCommand args, (err, info) ->
dreddCommandInfo = info
done(err)

it 'should inform about starting server with custom command', ->
assert.include dreddCommandInfo.stdout, 'Starting backend server process with command'
it 'should report problem with server process spawn', ->
assert.include dreddCommandInfo.stderr, 'Command to start backend server process failed, exiting Dredd'
it 'should exit with status 1', ->
assert.equal dreddCommandInfo.exitStatus, 1

for scenario in [
description: 'When crashes before requests'
Expand Down

0 comments on commit c2e9b80

Please sign in to comment.