Skip to content

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

Open
ymatsakova wants to merge 1 commit into
ealush:masterfrom
ymatsakova:unit-tests
Open

Unit testing proposal with @testing-library/react and jest#376
ymatsakova wants to merge 1 commit into
ealush:masterfrom
ymatsakova:unit-tests

Conversation

@ymatsakova

Copy link
Copy Markdown
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:

@vercel

vercel Bot commented Nov 17, 2023

Copy link
Copy Markdown

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
Copy Markdown
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.

Comment thread babel.config.js
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],

Copy link
Copy Markdown
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

@ealush ealush force-pushed the master branch 8 times, most recently from e1e9bc5 to 76f2b14 Compare October 19, 2025 22:14
@ealush ealush force-pushed the master branch 5 times, most recently from 6f0292c to d2af775 Compare November 22, 2025 13:03
@ealush ealush force-pushed the master branch 2 times, most recently from 467cac6 to d55c0c3 Compare January 22, 2026 21:30
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.

1 participant