Open utterances-bot opened 1 year ago
Thank you so much for this example! It also helped me to implement a testing environment with linkedom for my frontend app
Damn, this is an incredible article. I hope you can write another detailed article about Vitest in Node.js, delving deeply into its features, i rarely find a good tutorial on Node, sadly.
Thx, friend, you're a friend.
Thanks for the great article! Question though, I can understand using Vitest for unit tests. Could you provide context as to why we should also use it for E2E? I'm new to testing and when E2E is mentioned you'd hear about Playwright or Puppeteer.
This is very useful, thanks.
A question - What creates the new schema with the random name? Is that created when we run the migrations?
We're having trouble with extensions in the migrations, and I'd like to set up the extensions manually in the schema we're creating. I'd like to do that after the schema is created, but before the migrations run. Any suggestions? Thanks.
Thanks for the helpful article! Sharing a couple of ideas on how to simplified this setup quite a bit:
since 0.34.0 we "can specify a path to a valid JS/TS file", so no need to create a package for environment really.
Also notice: since 0.34.0 Vitest requires transformMode
option on environment object, read more;
we can use the workspaces to simplify configuration:
environment: 'node'
),environment: 'path/to/vitest-environment-prisma-file'
).
Creating a complete Node.js test environment with Vitest, PostgreSQL and Prisma | Douglas Pinheiro Goulart
Node.js complete test environment using TypeScript, Prisma, PostgreSQL and Vitest.
https://www.douglasgoulart.com/writings/creating-a-complete-nodejs-test-environment-with-vitest-postgresql-and-prisma?utterances=fa9fa6dd28d965170c3d8df6YzFjJa%2BwBuJPr57WA1l77tQBhb%2BlvVlrJuodMgNKTMHkQBmt8%2B2oJkcZNLDmQ4iZwZR4ER6eyGweqORgZm5RFWsuvG7UV0GiBv7zp9751vKF8VUge3%2BFVOBnKD8%3D