After discussion during today's Community Meeting, we discussed that it would be good to start working on adding some forms of testing whether it be with Jest or Cypress to test parts of the site as well as the business logic for some pages. This is going to be an open issue to discuss what would be best to implement for the .org site
Love this idea. I would love to see tests added with PRs for bigger site changes, and having a foundation to build on would make that more feasible.
I think a combination of Jest and Cypress tests would be useful; business logic and individual components in Jest as you could test things in isolation, and Cypress for integrating components together and testing overall pages. I would be happy contribute some tests, especially for accessibility in Cypress (focus management, auditing with accessibility test APIs, etc.).
So @DSchau and I just finished up a pair session on tackling the framework for this. The work is currently in this branch: https://github.com/DSchau/gatsby/tree/www/unit-tests
Some remaining tasks left include the following:
www/We should have a PR later this week to add this.
As well, it may be useful to have a docs page to possibly describe the toolchain we use for testing and how people can get started adding tests for various components for (or somewhere link to the Unit Testing docs page.)www/
So the first PR is going to push unit testing with Jest. We haven't started looking to integrate Cypress yet, but I think it is a good idea and likely should belong in a separate PR given they are kinda tackling two fronts
Nice job, seems like a good approach. I'm definitely up for adding some component tests once this is all set up 馃帀
Most helpful comment
Nice job, seems like a good approach. I'm definitely up for adding some component tests once this is all set up 馃帀