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
samuele16mo 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
samuele16mo 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
samuele16mo ago
what about the combo of detox for mobile & playwrite for web and api
julius
julius16mo 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
samuele16mo 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
samuele16mo 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
julius16mo 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
samuele16mo 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
julius16mo 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
samuele16mo ago
Good to know thx!
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
samuele
samuele16mo 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 User16mo ago
Message Not Public
Sign In & Join Server To View
samuele
samuele16mo ago
It’s not planned as the readme says U can look to t3-complete repo
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
samuele
samuele16mo ago
Btw vitest is way faster And supports ts ootb U should give it a try This repo here
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server
More Posts
How to set up a development and production database with PrismaI'm trying to set up two databases with prisma but there isn't much info available. I am trying to utRPC response time sometimes takes very longI'm noticing on my deployed next app that my trpc requests in the chrome browser takes up to 2 secon"Unsafe call of an `any` typed value." but everything is typedI'm using this exact same pattern in 10 other places in my app, but for some reason it is really madDebugging TRPC issues?Am I the only one having trouble debugging trpc code? I am talking specifically about endpoints. I getServerSideProps() fetches NextAuth session put fails to pass props to Next.js page componentsI'm building a note-taking app with ct3a, currently working on implementing basic auth features in treact query not updating the `error` field on errorsI'm new to using react query and i'm using axios to fetch an REST API, the api is throwing a 4xx errwhat's happening to tailwind's lsp client?yesterday I left my code working, but today I don't know what is happening with tailwind, I tried upinfinite streaming response with tRPC?I want to create a tRPC endpoint which calls to the docker log API (https://docs.docker.com/engine/atRPC + useSWR for fetching data from Shopify API ?I'm currently in the process of building a custom Shopify Store running with the T3 stack. I'm usinType error when using react-hook-form submit handlerSo I'm using react-hook-form with a fresh T3 app, but I'm getting the following error. Has anyone e