-
Notifications
You must be signed in to change notification settings - Fork 155
Conversation
This is a good start and covers 80% of what I had in my notes from our conversation. Thanks for getting the ball rolling! IntroLet's start with something more aspirational and with an example. Maybe grab some language from the initial comment in redwoodjs/redwood#181 Effectively, Jest tests in RW are first-class citizens, built into the CLI, templates with your generated code, and (soon) a GH Action for CI you can add. Out of the box you generate code, run Imports: routes, svg, etc.From this PR redwoodjs/redwood#521 We should point out that these imports are being automatically handled by the testing package. package exportsTo confirm: all the package exports (for importing) are covered in the doc from https://github.com/redwoodjs/redwood/blob/master/packages/testing/src/index.js Looks like Robert is already working on the MSW using workers to mock the server for API (seems very cool). @apollo/react-testingFrom the conversation in redwoodjs/redwood#629 I assumed this was already in the package. But maybe the MSW package is going to replace it? Will need to check back with Robert. Jest ConfigHere's the Issue for what's to be (aka Vision): redwoodjs/redwood#564 And here's where the current config files are for web and api: https://github.com/redwoodjs/redwood/tree/master/packages/core/config Technically someone could copy these config options within there app and extend them manually using a script. Not sure if we need to explain how to do that, but that's why I thought it important to include them. MiscI added the state of template test for generators to the "To Do" column on this project: https://github.com/redwoodjs/redwood/projects/4 Added "next steps for Test docs" list to "To Do": https://github.com/orgs/redwoodjs/projects/2 |
Robert has completed the work on the Jest Config extension capability. Here's his comment from the related Issue: |
@jtoar @thedavidprice When is this going to get merged? |
@guledali This week, hold me to it |
@jtoar Patiently waiting for the testing docs |
See redwoodjs/redwood#1620 regarding making Test DB env var usage explicit (depending on how the PR resolves). |
What's the best way to add onto this doc? Should I make PRs against your branch @jtoar? Although yours is like 600 commits out of date with the |
I was assuming you'd start fresh and use this for reference @cannikin fwiw... Thanks for getting it going again! |
Roger that. Okay, any objections to closing this PR and opening a new one with the doc I'm writing? Sorry @jtoar! |
Already at 2000 words and I haven't actually done any testing in Redwood yet. 😬 |
Opened #530 |
Closing, thanks @jtoar! |
This PR adds a Testing doc. There's going to be a lot of additions to testing, namely configuring jest, e2e and out-of-the-box ci, but right now this doc aims to cover the basics of how you'd test a Redwood app's api and web side.