Skip to content

Commit 3181e74

Browse files
author
Matthew Cantelon
committed
fix: broken tests from probot#18
When the `done` function was removed in probot#18, the tests were not updated
1 parent 0e6f825 commit 3181e74

File tree

2 files changed

+8
-48
lines changed

2 files changed

+8
-48
lines changed

tests/__snapshots__/index.test.js.snap

Lines changed: 0 additions & 44 deletions
This file was deleted.

tests/index.test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ describe('serverless-lambda', () => {
1414

1515
it('responds with the homepage', async () => {
1616
const event = { httpMethod: 'GET', path: '/probot' }
17-
await handler(event, context)
18-
expect(context.done).toHaveBeenCalled()
19-
expect(context.done.mock.calls[0][0]).toMatchSnapshot()
17+
const result = await handler(event, context)
18+
expect(result).toMatchObject({
19+
body: expect.any(String),
20+
statusCode: 200,
21+
headers: {
22+
'Content-Type': 'text/html'
23+
}
24+
})
2025
})
2126

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

3338
await handler(event, context)
34-
expect(context.done).toHaveBeenCalled()
3539
expect(spy).toHaveBeenCalled()
3640
})
3741

0 commit comments

Comments
 (0)