Skip to content

Overhaul Testing

Closed Jun 23, 2022 100% complete

Victory has several issues with it's current approach to unit testing and integration testing. It would be in the best interests of the project to reconfigure and modernize testing from the ground up.

Problems:

  • Current solution (Karma) is browser only. SSR/Node.js testing is not included and can potentially have issues not surfaced by solely browser-base…

Victory has several issues with it's current approach to unit testing and integration testing. It would be in the best interests of the project to reconfigure and modernize testing from the ground up.

Problems:

  • Current solution (Karma) is browser only. SSR/Node.js testing is not included and can potentially have issues not surfaced by solely browser-based testing.
  • All tests are confined within their own directory outside of the packages where the actual code being tested lives
  • Storybook/Chromatic screenshot testing works well, but forces use of Storybook into a very specific use case that doesn't allow for using it in a practical user testing sense, such adjusting knobs (props) for manually testing various render states.
  • Testing doesn't happen within CI/CD process

Potential Solutions:

  • Replace Karma altogether with single unit/integration testing library that allows for both browser and server based testing
  • Alternatively integrate a second server-based testing framework alongside Karma.
  • Integrate spec files within packages so they're more tightly scoped to their source, while being aware of leaving these out of the build process.
  • Integrate unit-testing (not just Chromatic testing) within the CI/CD pipeline
  • Come up with a way to allow Storybook to work for both Chromatic as well as manually user testing.

Open Questions:

  • Do we like enzyme over react-testing-library or another solution?
  • How efficient and thorough are the tests? How long do they take to run?
  • How are children within components handled for testing? Are we only concerned with shallow rendering or do we need to cover more?
Loading