E2E Tests t3-turbo stack

Hi guys I found out that in the community of the t3 stack, it’s common to use in the examples dirs the playwright for the e2e, but my question is... If I have a turbo repo with expo and nextjs with similar code... should I choose to test with cypress on both apps due to the lacking of playwright testing on iOS? or it’s enough to test it on the nextjs?
18 Replies
samuele
samueleOP2y ago
the purpose of this question is to find a lib or framework that can do unit and e2e tests like playwright all in one, having the ability to testing on the mobile native apps and web apps with different devices on the e2e side and unit tests in the apps or even in the packages like the trpc api or other libs that i made for the project...
samuele
samueleOP2y ago
i found out a project made by juliusmarminge https://github.com/juliusmarminge/t3-complete/blob/main/test/trpc/post-router.test.ts that in a normal repo not a turbo repo with playwright and vitest in that case but why not use playwright only?
GitHub
t3-complete/post-router.test.ts at main · juliusmarminge/t3-complete
Contribute to juliusmarminge/t3-complete development by creating an account on GitHub.
samuele
samueleOP2y ago
what about the combo of detox for mobile & playwrite for web and api
julius
julius2y ago
not sure - if cypress is workign for both sides then use that i guess? playwright and vitest in that case but why not use playwright only? not sure what you mean here, playwright can't do unit/integration tests
samuele
samueleOP2y ago
I checked and cypress can’t be used on mobile e2e on expo only web So playwright for nextjs and trpc And detox for expo e2e tests Do you have an example of a unit test on playwright for trpc crud? In this case u use vitest for trpc testing
samuele
samueleOP2y ago
I was talking about unit test with trpc, i think that the code made with vitest in the repo is the same thing if i use it with playwright Thx btw ❤️
julius
julius2y ago
sure you could write similar tests in playwright but playwright is an e2e test runner meant to test interactions in web apps - just using it for unit/integratoin tests will result in much slower test times but it's very nice that they use a very similar api how would you break the trpc test down further? i dont think unit testing makes sense here - the integration covers enough for me at least
samuele
samueleOP2y ago
I would use it in nextjs for e2e and for unit test for the trpc api Nono i was saying to use playwright instead of vitest making the test for a crud api for example and then the code for the BE and FE Instead of doing the FE side first and the BE on the end and finally the e2e test on the nextjs app like a TDD sample
julius
julius2y ago
i mean if you want to use playwright for everything go ahead but i dont know why it makes sense... playwright is huge compared to vitest and there's no harm in having two separate runners for different types of tests just running the 2 trpc tests in the repo now runs like 30% slower in playwright compared to vitest
samuele
samueleOP2y ago
Good to know thx!
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
samuele
samueleOP2y ago
Yeah i think so but at this point you can use playwright for both, It’s way faster than jest and it has ts support out of the box to Or vitest for unit tests and playwright for e2e
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
samuele
samueleOP2y ago
It’s not planned as the readme says U can look to t3-complete repo
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
samuele
samueleOP2y ago
Btw vitest is way faster And supports ts ootb U should give it a try This repo here
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server