how do I test Lambda functions using `yarn start` ...
# help
s
how do I test Lambda functions using
yarn start
if they’re not part of an API? 🤔 say I have 5 functions that are part of a step function, and I want to just test one of those in isolation. in Serverless Framework, I could just use
sls invoke local -f
to do this.
k
You could use the aws console and just send a test payload
s
I could, but the idea here would be to test quickly without having to deploy
k
Ah got it, that definitely would be helpful
f
Hey @Sam Hulick, your Lambda functions are deployed on
yarn start
, with stub code that sends requests to ur local.
So you can still use the Lambda console to invoke them.
s
Ah! So for example, in the AWS console I'd see something like "myfunc" and "myfunc-debug"?
@Frank ok, so this is what I find confusing. I just spun up a new stack with a single Lambda, not linked to any API at all. and I did
yarn deploy
and then
yarn start
. there’s no API endpoint so I can’t invoke the function locally. so there doesn’t seem to be feature parity with Serverless Framework’s
sls invoke local -f
. so in the docs here (https://docs.serverless-stack.com/migrating-from-serverless-framework#invoking-locally) , it might be more accurate to say that the equivalent to
sls invoke local
is to go into the AWS Console, go to the function, and test there
(or use the AWS CLI of course)
it’s cool that I get console.logs in my local shell
related: in
sst start
mode, if my Lambda function executes
/bin/whatever
, is it going to do that locally or in the cloud?
f
in the AWS console I’d see something like “myfunc” and “myfunc-debug”?
You will just see “myfunc”. In
sst start
mode, the same Lambda functions are deployed, just the code has been swapped with the stub code. So the same function name in the console.
the equivalent to 
sls invoke local
 is to go into the AWS Console
We are working on a UI console where you can invoke ur functions directly. For now, bare with the console 😉
if my Lambda function executes 
/bin/whatever
, is it going to do that locally or in the cloud?
If you mean the function does a
spawn
to run a script, yes that will be run locally.
s
all makes sense - thanks!
the live dev feature still blows my mind 😄 love how fast that feedback loop is