Skip to content

Commit

Permalink
fix: broken tests from probot#18
Browse files Browse the repository at this point in the history
When the `done` function was removed in probot#18, the tests were not updated
  • Loading branch information
Matthew Cantelon committed Nov 5, 2020
1 parent 0e6f825 commit 3181e74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 48 deletions.
44 changes: 0 additions & 44 deletions tests/__snapshots__/index.test.js.snap

This file was deleted.

12 changes: 8 additions & 4 deletions tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ describe('serverless-lambda', () => {

it('responds with the homepage', async () => {
const event = { httpMethod: 'GET', path: '/probot' }
await handler(event, context)
expect(context.done).toHaveBeenCalled()
expect(context.done.mock.calls[0][0]).toMatchSnapshot()
const result = await handler(event, context)
expect(result).toMatchObject({
body: expect.any(String),
statusCode: 200,
headers: {
'Content-Type': 'text/html'
}
})
})

it('calls the event handler', async () => {
Expand All @@ -31,7 +36,6 @@ describe('serverless-lambda', () => {
}

await handler(event, context)
expect(context.done).toHaveBeenCalled()
expect(spy).toHaveBeenCalled()
})

Expand Down

0 comments on commit 3181e74

Please sign in to comment.