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

Update the @testing-library/react dependency #940

Closed
nataliepina opened this issue Mar 8, 2023 · 13 comments
Closed

Update the @testing-library/react dependency #940

nataliepina opened this issue Mar 8, 2023 · 13 comments
Assignees
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed open-source react

Comments

@nataliepina
Copy link
Collaborator

nataliepina commented Mar 8, 2023

Description

We are a major version behind on React Testing Library. Update the dependency to the latest version -> 14.0.0. If there are any issue with our unit tests, please fix them.

@testing-library/react 13.4.0 → 14.0.0


Contribution Guide

Please review the How to Contribute guide beforehand.

@nataliepina nataliepina added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers dependencies Pull requests that update a dependency file open-source react labels Mar 8, 2023
@Yasir761
Copy link

I've updated the version but it showing some errors while I'm doing the commit.

@mstruebing
Copy link
Contributor

Hey @Yasir761 what kind of errors do you see?
Can you paste the CLI output?

@Yasir761
Copy link

@d2iq/ui-kit@0.0.0-dev+semantically-released test:types
tsc -p tsconfig.types.json

.storybook/docs/components/WelcomeBanner.tsx(3,32): error TS2307: Cannot find module '../../../packages/design-tokens/build/js/designTokens' or its corresponding type declarations.
and many more like this error.

@nataliepina
Copy link
Collaborator Author

@Yasir761 Could you double-check that you've run npm i and try out running npm run dist?

You can run npm run test:types in the CLI to do some debugging.
I've tested out the change on my end and I was able to create a commit without any errors, so it seems that you may be missing something in getting started with the project. Are you able to start storybook?

@Yasir761
Copy link

@nataliepina Yes, I was able to start the storybook and also did some debugging but, it still the giving same output.
Screenshot 2023-03-12 220256

@nataliepina
Copy link
Collaborator Author

nataliepina commented Mar 12, 2023

I see the issue here @Yasir761. We have commit message linting. You will need to prefix your commit message with a commit type. For example git commit -m "chore: update the version of react testing library". There is also a character limit for that commit message so you may need to adjust as needed. This is all outlined in more detail in the How to Contribute Guide.

Let me know if you're still having issues with committing after that!

@Yasir761
Copy link

@nataliepina , It still shows the same message.

@nataliepina
Copy link
Collaborator Author

Could you review the steps to contribute one last time and make sure you've completed each step?
Then if you encounter an error, could you outline what you've entered in the CLI and send a screenshot here with everything in view?

You should be able to commit this after a git add . and then git commit -m "chore: update the version of react testing library". You will need to wait a minute or two and then it will finish committing. Then you can git push.

I have tested it out with those commands and here is a successful flow:
Screenshot 2023-03-13 at 7 11 45 AM

@Yasir761
Copy link

I tried all but now it showing this
Screenshot 2023-03-13 223723

@nataliepina
Copy link
Collaborator Author

Judging by the errors it looks like you have something extra that needs to be deleted that is throwing off the formatting. These errors are triggered by Prettier which we use to format the code. Try to run npm run setup:git-hooks first. Our pre-commit hook runs npm run test:types && npm run lint so you can try to run those locally as well to check if you have everything set up correctly. You can run npm run format to format the code which may fix the issue. I also might suggest adding the Prettier extension if you're using VSCode and set up Format on Save, so it will correct any formatting issues for you. Make sure that the only 2 files that are changed are package.json and package-lock.json and that both of them are committed.

If all of that fails, you may want to remove your changes altogether and try again. Or look over the changes and compare the differences to see if there is an extra character or something formatted incorrectly.

An overview of the changes to implement the new version:

  1. Set up the working local development environment, which you probably have already.
  2. In the CLI, at the root run npm i @testing-library/react --save-exact
  3. Look over the changes and if everything is working you can now commit the changes.

@nataliepina
Copy link
Collaborator Author

Hi @Yasir761 were you able to resolve the issues and able to commit? Please let us know if you're still encountering anything else with that.

@Yasir761
Copy link

I try everything but don't know why it is showing same error to me

@nataliepina
Copy link
Collaborator Author

I'm sorry you're encountering problems with this! I'm going to attempt this update again to make sure there aren't any problems on our end, and I will update it if all goes well. For that reason, I will close this issue out. We should be adding more issues here soon if you'd like another opportunity to contribute. Thanks for your interest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed open-source react
Projects
None yet
Development

No branches or pull requests

3 participants