Skip to content

Commit

Permalink
fix existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbalfour committed Jan 12, 2024
1 parent ad14a2c commit 78287f8
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions packages/modules/edge-api-sdk/tests/edge-api-sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const testEventType = (generateRequest: RequestGenerator, generateResponse: Resp
}),
{},
)
const request: JSONRequest<any, any> = {
const request = {
headers: {
host: ['google.com'],
},
Expand All @@ -208,9 +208,9 @@ const testEventType = (generateRequest: RequestGenerator, generateResponse: Resp
},
region: 'eu-west-2',
cookies: [],
meta: {} as any,
}
expect(handler).toHaveBeenCalledWith(request)
const { logger, meta, ...rest } = handler.mock.lastCall[0]
expect(rest).toEqual(request)
})
it('should cope with no querystring', async () => {
const handler = jest.fn().mockResolvedValue({})
Expand All @@ -220,7 +220,7 @@ const testEventType = (generateRequest: RequestGenerator, generateResponse: Resp
}),
{},
)
const request: JSONRequest<any, any> = {
const request = {
headers: {
host: ['google.com'],
},
Expand All @@ -230,9 +230,9 @@ const testEventType = (generateRequest: RequestGenerator, generateResponse: Resp
path: '/',
region: 'eu-west-2',
cookies: [],
meta: {} as any,
}
expect(handler).toHaveBeenCalledWith(request)
const { logger, meta, ...rest } = handler.mock.lastCall[0]
expect(rest).toEqual(request)
})
})

Expand Down Expand Up @@ -279,7 +279,7 @@ const testEventType = (generateRequest: RequestGenerator, generateResponse: Resp
}),
{},
)
const request: JSONRequest<any, any> = {
const request = {
env,
headers: {
host: ['google.com'],
Expand All @@ -289,9 +289,9 @@ const testEventType = (generateRequest: RequestGenerator, generateResponse: Resp
path: '/',
region: 'eu-west-2',
cookies: [],
meta: {} as any,
}
expect(handler).toHaveBeenCalledWith(request)
const { logger, meta, ...rest } = handler.mock.lastCall[0]
expect(rest).toEqual(request)
})
})

Expand Down Expand Up @@ -338,7 +338,7 @@ const testEventType = (generateRequest: RequestGenerator, generateResponse: Resp
}),
{} as any,
)
const request: JSONRequest<any, any> = {
const request = {
env,
headers: {
host: ['google.com'],
Expand All @@ -349,9 +349,9 @@ const testEventType = (generateRequest: RequestGenerator, generateResponse: Resp
region: 'eu-west-2',
cookies: [],
body: { something: 'here' },
meta: {} as any,
}
expect(handler).toHaveBeenCalledWith(request)
const { logger, meta, ...rest } = handler.mock.lastCall[0]
expect(rest).toEqual(request)
})
})
})
Expand All @@ -371,7 +371,7 @@ const testEventType = (generateRequest: RequestGenerator, generateResponse: Resp
}),
{} as any,
)
const request: JSONRequest<any, any> = {
const request = {
env,
headers: {
host: ['google.com'],
Expand All @@ -382,9 +382,9 @@ const testEventType = (generateRequest: RequestGenerator, generateResponse: Resp
region: 'eu-west-2',
cookies: [],
body: { something: 'here' },
meta: {} as any,
}
expect(handler).toHaveBeenCalledWith(request)
const { logger, meta, ...rest } = handler.mock.lastCall[0]
expect(rest).toEqual(request)
})
})
}
Expand Down

0 comments on commit 78287f8

Please sign in to comment.