T
TanStack6d ago
rare-sapphire

Unit testing with Tanstack Start

Hey guys, I can't find any info on this so hoping someone here can help. I want to put unit tests in place for some of my server functions and middleware but I haven't been able to figure out how to call the relevant handlers. Currently the only way I can tests the handler logic is to split it out from the server function definition (i.e. export a function and supply to the .handler / .server methods) but this feels like overkill and I'm not sure I want to expose functions just for the sake of testing discrete parts of the flow - doesn't feel right. Anyone got any insight on this one? (Also saw this question but no answer/insight given https://discord.com/channels/719702312431386674/1387643349741338724)
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?