Gatsby: [www]: Implement testing for www site

Created on 13 Mar 2019  路  4Comments  路  Source: gatsbyjs/gatsby

Summary

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

Resources

question or discussion

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 馃帀

All 4 comments

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:

  • [x] add a task to Circle CI to run the www tests
  • [ ] create an issue on GitHub to reach out to the community to build unit tests for various components in 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 www/ (or somewhere link to the Unit Testing docs page.)

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 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

3CordGuy picture 3CordGuy  路  3Comments

mikestopcontinues picture mikestopcontinues  路  3Comments

ghost picture ghost  路  3Comments

hobochild picture hobochild  路  3Comments

ferMartz picture ferMartz  路  3Comments