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

What is the best practice to use rustywind with jest ? #41

Open
puneetmakkar opened this issue Oct 1, 2021 · 1 comment
Open

What is the best practice to use rustywind with jest ? #41

puneetmakkar opened this issue Oct 1, 2021 · 1 comment

Comments

@puneetmakkar
Copy link

puneetmakkar commented Oct 1, 2021

Hi @praveenperera ,

Thanks for the great package.

We are using lint-staged and husky for pre-commit hooks.

rustywind changes the class order on changed files on commit and later jest test fails as snapshots have not been updated.
test failure causes the rustywind changes to be reverted.

any idea on how can we resolve the issue ?

"lint-staged": {
  "*.{js,jsx,ts,tsx}": [
    "rustywind --write",
    "cross-env CI=true react-scripts test --findRelatedTests"
  ]
},
"husky": {
  "hooks": {
    "pre-commit": "lint-staged",
    "post-commit": "git update-index -g"
  }
}

Thanks.

@ftonato
Copy link
Contributor

ftonato commented Mar 23, 2022

Hello @puneetmakkar,

I could be completely wrong, but if you need to generate the snapshots correctly, you need to run the command rustywind --write as well before generating them, this way the problem will be avoided 🏆

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