Good thread that lands on "use vite" just above. I...
# general
m
Good thread that lands on "use vite" just above. I'm curious if anybody is using vitest for testing stacks and constructs. The latest SST examples seem to use it to test lambda functions, but I haven't seen - or got it to work - for unit testing stacks and constructs yet. Can we yeet jest yet?
r
We intend to use it, I tried to switch our tests over and there were some incompatibilities despite the Jest-like UI. So it’s on the to-do list
t
I just yeeted jest on the sst codebase itself lol
went hard this morning/last night and got it all moved over without changing much besides importing from vitest
I haven't published stack test examples yet (although @manitej I think is updating one right now) reason being is I noticed a design issue with the previous way we were doing stack tests. Because we have
stacks/index.ts
as the entry point where you can do stuff like
app.setDefaultFunctionProps
- solely testing the stack won't be an accurate test
m
Ha. I looked earlier today and it was still on jest then. 😄
That's great. I'll look forward to seeing those. I really want to move a lot of stuff we have to vitest, including non-serverless stuff if I can mange it.
Okay, got an SST stack onto vitest very easily, but my CDK stack without SST (sorry, have many of those ATM) doesn’t behave as well.