We are having some trouble testing lambda function...
# help
m
We are having some trouble testing lambda functions in sst with jest. The mocking seems to be broken. Mainly issues with using spyOn and mocking custom modules. Running
sst test
, it does it's
sst
thing before running the test and this step seems to be the main issue. However, when we use jest directly (like in a standard cdk project) mocking works fine and test pass the same. Are we missing anything by using the testing library directly?
t
I'd suggest just using jest directly
That's what I do personally,
sst test
is there so beginner projects have something working out of the box but it's pretty hard to create something useful that works for everyone
m
Awesome thanks for the vote of confidence