Skip to content

Commit

Permalink
test: Updating stdout expectations to new format
Browse files Browse the repository at this point in the history
  • Loading branch information
anth0d committed Aug 18, 2017
1 parent 53cd595 commit 5dcf724
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test/integration/cli/cli-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ describe 'CLI', ->
)

it 'should notify skipping to the stdout', ->
assert.include runtimeInfo.dredd.stdout, 'skip: GET /machines'
assert.include runtimeInfo.dredd.stdout, 'skip: GET (200) /machines'

it 'should hit the only transaction', ->
assert.deepEqual runtimeInfo.server.requestCounts, {'/message': 1}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/dredd-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ describe 'Dredd class Integration', ->
assert.include stderr, 'Fixed transaction name'

describe('when Swagger document has multiple responses', ->
reTransaction = /(\w+): (\w+) \/honey/g
reTransaction = /(\w+): (\w+) \(\d+\) \/honey/g
matches = undefined

beforeEach((done) ->
Expand Down Expand Up @@ -577,7 +577,7 @@ describe 'Dredd class Integration', ->
)

describe('when Swagger document has multiple responses and hooks unskip some of them', ->
reTransaction = /(\w+): (\w+) \/honey/g
reTransaction = /(\w+): (\w+) \(\d+\) \/honey/g
matches = undefined

beforeEach((done) ->
Expand Down
8 changes: 4 additions & 4 deletions test/integration/regressions/regression-319-354-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ describe 'Regression: Issues #319 and #354', ->

describe 'Attributes defined in resource are referenced from payload [GET /bricks/XYZ42]', ->
it 'fails on missing required property and invalid type', ->
assert.include results.failures[0], 'GET /bricks/XYZ42'
assert.include results.failures[0], 'GET (200) /bricks/XYZ42'
assert.include results.failures[1], 'Missing required property: name'
assert.include results.failures[1], 'Invalid type: number'
it 'has no request body', ->
Expand All @@ -251,7 +251,7 @@ describe 'Regression: Issues #319 and #354', ->

describe 'Attributes defined in resource are referenced from action [POST /bricks]', ->
it 'fails on missing required property and invalid type', ->
assert.include results.failures[2], 'POST /bricks'
assert.include results.failures[2], 'POST (200) /bricks'
assert.include results.failures[3], 'Missing required property: name'
assert.include results.failures[3], 'Invalid type: number'
it 'has correct request body', ->
Expand All @@ -265,7 +265,7 @@ describe 'Regression: Issues #319 and #354', ->

describe 'Attributes defined as data structure are referenced from payload [GET /customers]', ->
it 'fails on invalid type', ->
assert.include results.failures[4], 'GET /customers'
assert.include results.failures[4], 'GET (200) /customers'
assert.include results.failures[5], 'Invalid type: object'
it 'has no request body', ->
assert.isUndefined results.bodies[6]
Expand All @@ -278,7 +278,7 @@ describe 'Regression: Issues #319 and #354', ->

describe 'Attributes defined as data structure are referenced from action [POST /customers]', ->
it 'fails on invalid types', ->
assert.include results.failures[6], 'POST /customers'
assert.include results.failures[6], 'POST (200) /customers'
assert.include results.failures[7], 'Invalid type: null'
assert.include results.failures[7], 'Invalid type: string'
it 'has correct request body', ->
Expand Down
8 changes: 4 additions & 4 deletions test/unit/transaction-runner-test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ describe 'TransactionRunner', ->
it 'should callback with a properly configured transaction', (done) ->
runner.configureTransaction transaction, (err, configuredTransaction) ->
assert.equal configuredTransaction.name, 'Group Machine > Machine > Delete Message > Bogus example name'
assert.equal configuredTransaction.id, 'POST /machines'
assert.equal configuredTransaction.id, 'POST (202) /machines'
assert.isOk configuredTransaction.host
assert.isOk configuredTransaction.request
assert.isOk configuredTransaction.expected
Expand All @@ -337,7 +337,7 @@ describe 'TransactionRunner', ->

it 'should join the endpoint path with transaction uriTemplate together', (done) ->
runner.configureTransaction transaction, (err, configuredTransaction) ->
assert.equal configuredTransaction.id, 'POST /machines'
assert.equal configuredTransaction.id, 'POST (202) /machines'
assert.strictEqual configuredTransaction.host, 'hostname.tld'
assert.equal configuredTransaction.port, 9876
assert.strictEqual configuredTransaction.protocol, 'https:'
Expand All @@ -347,7 +347,7 @@ describe 'TransactionRunner', ->
it 'should keep trailing slash in url if present', (done) ->
transaction.request.uri = '/machines/'
runner.configureTransaction transaction, (err, configuredTransaction) ->
assert.equal configuredTransaction.id, 'POST /machines/'
assert.equal configuredTransaction.id, 'POST (202) /machines/'
assert.strictEqual configuredTransaction.fullPath, '/my/path/to/api' + '/machines/'
done()

Expand All @@ -356,7 +356,7 @@ describe 'TransactionRunner', ->
beforeEach ->
transaction =
name: 'Group Machine > Machine > Delete Message > Bogus example name'
id: 'POST /machines'
id: 'POST (202) /machines'
host: '127.0.0.1'
port: '3000'
request:
Expand Down

0 comments on commit 5dcf724

Please sign in to comment.