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

Unit testing proposal with @testing-library/react and jest #376

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ymatsakova
Copy link
Contributor

In this PR:

  • Added the following dependencies to set up test environment:
    • babel/preset-env,
    • @babel/preset-typescript
    • @testing-library/jest-dom
    • @testing-library/react
    • babel-jest
    • identity-obj-proxy
    • jest
    • jest-environment-jsdom
  • Bumped @babel/core to v.7.23.3
  • Added jest and babel configs to integrate React Testing Library with Jest
  • Added a few examples of unit tests for Search component

The following docs were used:

Copy link

vercel bot commented Nov 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
emoji-picker-react ❌ Failed (Inspect) Nov 17, 2023 1:59pm

@ymatsakova
Copy link
Contributor Author

Hello @ealush. Sorry for taking time to get back to you with a proposal for unit testing. Let me know what you think.

@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jest doesn't support TypeScript. Babel just converts .tsx files into .js for Jest

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

Successfully merging this pull request may close these issues.

None yet

1 participant