Fix updating snapshots on pnpm test
Fixes: #5783
Deploy Preview for plone-components canceled.
| Name | Link |
|---|---|
| Latest commit | 88fe392fdc62e8f7d1f08792353ee9735acdc38e |
| Latest deploy log | https://app.netlify.com/sites/plone-components/deploys/664b08d0365f8a0008dc15fb |
@Hrittik20 adding the -u flag means you update the snapshots regardless if you want todo that or not. You want to run the test, see that it fails because most of the time you made a mistake and hence tests fail. There are instances where yes you make changes that require testing snapshot update but then you can mention that you want to update the test.
You didn't understand the issue @ksuess added and what she proposed.
If you look there are :ci commands https://github.com/plone/volto/blob/main/package.json#L18 and non :ci commands. She proposes to modify the test command to use the test from packages/volto https://github.com/plone/volto/blob/main/packages/volto/package.json#L43 and add a new test:ci command where test:ci from packages/volto is used.
This way if someone runs the tests from the root of the monorepo they can update the
tests since the test run allows to select the action todo
@ichim-david Apologies for the misunderstanding. So will the issue be solved if I modified package.json like this :
"test": "pnpm --filter @plone/volto run test", "test:ci": "pnpm --filter @plone/volto run test:ci",
@ichim-david Apologies for the misunderstanding. So will the issue be solved if I modified package.json like this :
"test": "pnpm --filter @plone/volto run test", "test:ci": "pnpm --filter @plone/volto run test:ci",
@Hrittik20 You have to check where pnpm test is used and modify those instances to use pnpm test:ci command which you will add besides modifying the current test command
@Hrittik20 you can use:
pnpm test -- -u
It does the trick, by passing args to pnpm scripts (as it did always, it's not a pnpm trick). If you do not mind, I'd close this one.