I’m working on upgrading to serverless v4 with serverless-offline v14.4.0. When running our integration tests, we spin up serverless offline and hit the APIs using supertest or equivalent.
The command looks something like this:
slsOfflineProcess = spawn('./node_modules/.bin/sls', [
'offline',
'start',
'--lambdaPort',
'4000',
'--httpPort',
port,
'--noPrependStageInUrl',
'--useInProcess',
]);
Even though the tests run, it doesn’t appear to be collecting coverage for many of these. Additionally, our shutdown function used to be able to kill the service with slsOfflineProcess.kill()
.
But now, there’s a whole different PID that’s listening to port 4000 (see command above), and I have to find the process with lsof -i :4000
.
When upgrading from v2 to v3, I had to add the useInProcess
. But here it does not see to be working.
Anyone have any suggestions?