Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how tests should be structured in our repo #313

Open
jplhomer opened this issue Nov 29, 2021 · 1 comment
Open

Document how tests should be structured in our repo #313

jplhomer opened this issue Nov 29, 2021 · 1 comment
Assignees

Comments

@jplhomer
Copy link
Contributor

In CONTRIBUTING.md we should spell out how tests should be structured and written.

Our unwritten rules up to this point:

  • Tests should live in a tests folder (NOT __tests__)
  • Tests should end with *.test.ts(x) (NOT .spec.tsx(x))
  • Tests should be wrapped with an outer describe('<ComponentName>')
  • Use @shopify/react-testing library to test React components
  • Use factories (faker) instead of hardcoded fixtures

Note that we have older tests that don't adhere to this convention, but we should migrate them over to this new convention.

@jplhomer jplhomer self-assigned this Mar 4, 2022
@frehner
Copy link
Contributor

frehner commented Apr 19, 2022

I'm in the process of adding Vitest to hydrogen-ui, and I'll add the docs in the CONTRIBUTING.md file for h-ui for these things. 👍

rafaelstz pushed a commit to rafaelstz/hydrogen that referenced this issue Mar 4, 2023
Merge `hydrogen-remix` package into `hydrogen`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants