Is it a good idea to run integration tests on my CI using serverless offline?
I am on AWS and I want to test the Lambda <-> SQS integration.
My Lambda reads from an API Gateway, which I know is emulated on the serverless offline.
const JEST_SLS_OFFLINE_URL = localhost:3000 // Default sls offline url
describe('Version endpoint ', () => {
const fetchUser = async () => {
const url = `${String(JEST_SLS_OFFLINE_URL)}/user/123`
}
test('Should fetchUser', async () => {
expect(await fetchUser()).toBe('')
})
})
An alternative is to spin up a new servererless function on AWS (for every PR), which is quite resource consuming