jest-dom | : owl : Custom jest matchers to test the state of the DOM | Testing library

 by   testing-library JavaScript Version: v5.16.5 License: MIT

kandi X-RAY | jest-dom Summary

jest-dom is a JavaScript library typically used in Testing, Jest applications. jest-dom has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can install using 'npm i node-jest-dom-matchers' or download it from GitHub, npm.
:owl: Custom jest matchers to test the state of the DOM
    Support
      Quality
        Security
          License
            Reuse
            Support
              Quality
                Security
                  License
                    Reuse

                      kandi-support Support

                        summary
                        jest-dom has a medium active ecosystem.
                        summary
                        It has 3842 star(s) with 321 fork(s). There are 28 watchers for this library.
                        summary
                        There were 2 major release(s) in the last 12 months.
                        summary
                        There are 69 open issues and 134 have been closed. On average issues are closed in 72 days. There are 22 open pull requests and 0 closed requests.
                        summary
                        It has a neutral sentiment in the developer community.
                        summary
                        The latest version of jest-dom is v5.16.5
                        jest-dom Support
                          Best in #Testing
                            Average in #Testing
                            jest-dom Support
                              Best in #Testing
                                Average in #Testing

                                  kandi-Quality Quality

                                    summary
                                    jest-dom has 0 bugs and 0 code smells.
                                    jest-dom Quality
                                      Best in #Testing
                                        Average in #Testing
                                        jest-dom Quality
                                          Best in #Testing
                                            Average in #Testing

                                              kandi-Security Security

                                                summary
                                                jest-dom has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
                                                summary
                                                jest-dom code analysis shows 0 unresolved vulnerabilities.
                                                summary
                                                There are 0 security hotspots that need review.
                                                jest-dom Security
                                                  Best in #Testing
                                                    Average in #Testing
                                                    jest-dom Security
                                                      Best in #Testing
                                                        Average in #Testing

                                                          kandi-License License

                                                            summary
                                                            jest-dom is licensed under the MIT License. This license is Permissive.
                                                            summary
                                                            Permissive licenses have the least restrictions, and you can use them in most projects.
                                                            jest-dom License
                                                              Best in #Testing
                                                                Average in #Testing
                                                                jest-dom License
                                                                  Best in #Testing
                                                                    Average in #Testing

                                                                      kandi-Reuse Reuse

                                                                        summary
                                                                        jest-dom releases are available to install and integrate.
                                                                        summary
                                                                        Deployable package is available in npm.
                                                                        summary
                                                                        Installation instructions, examples and code snippets are available.
                                                                        jest-dom Reuse
                                                                          Best in #Testing
                                                                            Average in #Testing
                                                                            jest-dom Reuse
                                                                              Best in #Testing
                                                                                Average in #Testing
                                                                                  Top functions reviewed by kandi - BETA
                                                                                  kandi has reviewed jest-dom and discovered the below as its top functions. This is intended to give you an instant insight into jest-dom implemented functionality, and help decide if they suit your requirements.
                                                                                  • Checks if an element has has the expected class names .
                                                                                    • Attaches an error message to an element .
                                                                                      • Checks an element to be part of another element .
                                                                                        • Assert that the given html element has an expected value .
                                                                                          • Checks the checked element to be checked
                                                                                            • Checks if an element has the description
                                                                                              • Validates the value of an HTML element .
                                                                                                • Checks if the entry has a readable description .
                                                                                                  • Checks if an element has the attributes .
                                                                                                    • Checks if an element has a valid name .
                                                                                                      Get all kandi verified functions for this library.
                                                                                                      Get all kandi verified functions for this library.

                                                                                                      jest-dom Key Features

                                                                                                      :owl: Custom jest matchers to test the state of the DOM

                                                                                                      jest-dom Examples and Code Snippets

                                                                                                      Installation
                                                                                                      npmdot imgLines of Code : 2dot imgno licencesLicense : No License
                                                                                                      copy iconCopy
                                                                                                      
                                                                                                                                          npm install --save-dev @testing-library/react
                                                                                                      
                                                                                                      yarn add --dev @testing-library/react
                                                                                                      
                                                                                                      Community Discussions

                                                                                                      Trending Discussions on jest-dom

                                                                                                      Cannot find module 'react-dom/client' from 'node_modules/@testing-library/react/dist/pure.js'
                                                                                                      chevron right
                                                                                                      Error while loading rule 'prettier/prettier': context.getPhysicalFilename is not a function
                                                                                                      chevron right
                                                                                                      Errors with create-react-app my-app redux with new react 18.0.0
                                                                                                      chevron right
                                                                                                      Invalid options object. Dev Server has been initialized using an options object that does not match the API schema
                                                                                                      chevron right
                                                                                                      The unauthenticated git protocol on port 9418 is no longer supported
                                                                                                      chevron right
                                                                                                      Consider using the "jsdom" test environment
                                                                                                      chevron right
                                                                                                      Sign-in page wont show up
                                                                                                      chevron right
                                                                                                      Switch' is not exported from 'react-router-dom'
                                                                                                      chevron right
                                                                                                      Module not found: Error: Can't resolve 'date-fns/addDays' in 'C:\Users\
                                                                                                      chevron right
                                                                                                      NPM CI error bindings not accessible from watchpack-chokidar2:fsevents
                                                                                                      chevron right

                                                                                                      QUESTION

                                                                                                      Cannot find module 'react-dom/client' from 'node_modules/@testing-library/react/dist/pure.js'
                                                                                                      Asked 2022-Apr-05 at 14:17

                                                                                                      hope someone could help me here. while running npm test got following mistake

                                                                                                      all neccesserry packages seem to be installed. I was trying to reinstall react-dom and didnot help. Below providing imports used in my test file:

                                                                                                      import React from "react";
                                                                                                      import { render, screen } from '@testing-library/react';
                                                                                                      import userEvent from '@testing-library/user-event';
                                                                                                      import '@testing-library/jest-dom';
                                                                                                      

                                                                                                      was trying to solve this for few days... thank you in advance for any help

                                                                                                      P.S.Additionally providing my package.json

                                                                                                      {
                                                                                                        "name": "fe",
                                                                                                        "version": "0.1.0",
                                                                                                        "private": true,
                                                                                                        "dependencies": {
                                                                                                          "@fontsource/roboto": "^4.5.3",
                                                                                                          "@material-ui/core": "^4.12.3",
                                                                                                          "@material-ui/icons": "^4.11.2",
                                                                                                          "@mui/icons-material": "^5.5.0",
                                                                                                          "@mui/material": "5.5.3",
                                                                                                          "@mui/styles": "^5.5.1",
                                                                                                          "@reduxjs/toolkit": "^1.8.0",
                                                                                                          "@testing-library/jest-dom": "5.16.3",
                                                                                                          "@testing-library/react": "13.0.0",
                                                                                                          "@testing-library/user-event": "14.0.4",
                                                                                                          "axios": "^0.26.1",
                                                                                                          "react": "^17.0.2",
                                                                                                          "react-dom": "^17.0.2",
                                                                                                          "react-hook-form": "^7.28.1",
                                                                                                          "react-redux": "^7.2.6",
                                                                                                          "react-router-dom": "^6.2.2",
                                                                                                          "react-scripts": "5.0.0",
                                                                                                          "redux": "^4.1.2",
                                                                                                          "styled-components": "^5.3.5",
                                                                                                          "web-vitals": "^2.1.4",
                                                                                                          "yup": "^0.32.11"
                                                                                                        },
                                                                                                        "scripts": {
                                                                                                          "start": "react-scripts start",
                                                                                                          "build": "react-scripts build",
                                                                                                          "test": "react-scripts test",
                                                                                                          "eject": "react-scripts eject"
                                                                                                        },
                                                                                                        "browserslist": {
                                                                                                          "production": [
                                                                                                            ">0.2%",
                                                                                                            "not dead",
                                                                                                            "not op_mini all"
                                                                                                          ],
                                                                                                          "development": [
                                                                                                            "last 1 chrome version",
                                                                                                            "last 1 firefox version",
                                                                                                            "last 1 safari version"
                                                                                                          ]
                                                                                                        },
                                                                                                        "devDependencies": {
                                                                                                          "@types/jest": "^27.4.0",
                                                                                                          "@types/node": "^16.11.25",
                                                                                                          "@types/react": "^17.0.39",
                                                                                                          "@types/react-dom": "^17.0.11",
                                                                                                          "@types/styled-components": "^5.1.24",
                                                                                                          "@typescript-eslint/eslint-plugin": "^5.12.0",
                                                                                                          "@typescript-eslint/parser": "^5.12.0",
                                                                                                          "eslint": "^8.9.0",
                                                                                                          "eslint-config-airbnb": "^19.0.4",
                                                                                                          "eslint-config-prettier": "^8.4.0",
                                                                                                          "eslint-import-resolver-typescript": "^2.5.0",
                                                                                                          "eslint-plugin-import": "^2.25.4",
                                                                                                          "eslint-plugin-jsx-a11y": "^6.5.1",
                                                                                                          "eslint-plugin-prettier": "^4.0.0",
                                                                                                          "eslint-plugin-react": "^7.28.0",
                                                                                                          "eslint-plugin-react-hooks": "^4.3.0",
                                                                                                          "prettier": "2.5.1",
                                                                                                          "typescript": "^4.5.5"
                                                                                                        }
                                                                                                      }
                                                                                                      
                                                                                                      

                                                                                                      ANSWER

                                                                                                      Answered 2022-Apr-02 at 09:43

                                                                                                      I think it's because your @testing-library/react using the newer version, just test with version of 12.1.2

                                                                                                      Source https://stackoverflow.com/questions/71713405

                                                                                                      QUESTION

                                                                                                      Error while loading rule 'prettier/prettier': context.getPhysicalFilename is not a function
                                                                                                      Asked 2022-Apr-04 at 13:24

                                                                                                      I am learning react js. I am a very beginner at this topic. But when I am doing setup to create a react environment I got an error. I have tried to solve the problem by Charles Stover blog in medium. But I got an error Command "up" not found.

                                                                                                      Here's my index.js file:

                                                                                                      import React from 'react';
                                                                                                      import ReactDOM from 'react-dom';
                                                                                                      import App from './App';
                                                                                                      import reportWebVitals from './reportWebVitals';
                                                                                                      ReactDOM.render(
                                                                                                         
                                                                                                            
                                                                                                         ,
                                                                                                      document.getElementById('root')
                                                                                                      );
                                                                                                      reportWebVitals();
                                                                                                      

                                                                                                      My package.json file:

                                                                                                      {
                                                                                                        "name": "myreact",
                                                                                                        "version": "0.1.0",
                                                                                                        "private": true,
                                                                                                        "dependencies": {
                                                                                                          "@testing-library/jest-dom": "^5.11.4",
                                                                                                          "@testing-library/react": "^11.1.0",
                                                                                                          "@testing-library/user-event": "^12.1.10",
                                                                                                          "react": "^17.0.2",
                                                                                                          "react-dom": "^17.0.2",
                                                                                                          "react-scripts": "4.0.3",
                                                                                                          "web-vitals": "^1.0.1"
                                                                                                        },
                                                                                                        "scripts": {
                                                                                                          "start": "react-scripts start",
                                                                                                          "build": "react-scripts build",
                                                                                                          "test": "react-scripts test",
                                                                                                          "eject": "react-scripts eject",
                                                                                                          "lint": "yarn add -D prettier && yarn add -D babel-eslint && npx install-peerdeps --dev eslint-config-airbnb && yarn add -D eslint-config-prettier eslint-plugin-prettier"
                                                                                                        },
                                                                                                        "eslintConfig": {
                                                                                                          "extends": [
                                                                                                            "react-app",
                                                                                                            "react-app/jest"
                                                                                                          ]
                                                                                                        },
                                                                                                        "browserslist": {
                                                                                                          "production": [
                                                                                                            ">0.2%",
                                                                                                            "not dead",
                                                                                                            "not op_mini all"
                                                                                                          ],
                                                                                                          "development": [
                                                                                                            "last 1 chrome version",
                                                                                                            "last 1 firefox version",
                                                                                                            "last 1 safari version"
                                                                                                          ]
                                                                                                        },
                                                                                                        "devDependencies": {
                                                                                                          "babel-eslint": "^10.1.0",
                                                                                                          "eslint": "7.2.0",
                                                                                                          "eslint-config-airbnb": "18.2.1",
                                                                                                          "eslint-config-prettier": "^8.3.0",
                                                                                                          "eslint-plugin-import": "2.22.1",
                                                                                                          "eslint-plugin-jsx-a11y": "6.4.1",
                                                                                                          "eslint-plugin-prettier": "^4.0.0",
                                                                                                          "eslint-plugin-react": "7.21.5",
                                                                                                          "eslint-plugin-react-hooks": "1.7.0",
                                                                                                          "prettier": "^2.3.2"
                                                                                                        }
                                                                                                      }
                                                                                                      

                                                                                                      When I am running yarn start in terminal, I am getting an error.

                                                                                                      Error while loading rule 'prettier/prettier': context.getPhysicalFilename is not a function
                                                                                                      Occurred while linting F:\react-projects\myreact\src\index.js
                                                                                                      

                                                                                                      Now what should I do?

                                                                                                      ANSWER

                                                                                                      Answered 2021-Sep-06 at 09:40

                                                                                                      I got two different solution.

                                                                                                      1. remove
                                                                                                      "prettier/prettier": [
                                                                                                                  "error",
                                                                                                                  {
                                                                                                                      "trailingComma": "es5",
                                                                                                                      "singleQuote": true,
                                                                                                                      "printWidth": 100,
                                                                                                                      "tabWidth": 4,
                                                                                                                      "semi": true,
                                                                                                                      "endOfLine": "auto"
                                                                                                                  }
                                                                                                              ]
                                                                                                      

                                                                                                      from .eslintrc folder and change react script version from 4.0.3 to 4.0.1 and run npm install.

                                                                                                      1. Use yarn upgrade -R eslint and change react script version from 4.0.3 to 4.0.1 and run npm install.

                                                                                                      Source https://stackoverflow.com/questions/69069719

                                                                                                      QUESTION

                                                                                                      Errors with create-react-app my-app redux with new react 18.0.0
                                                                                                      Asked 2022-Apr-01 at 09:56

                                                                                                      I am trying to create a react app with redux with the general command of npx and I am getting this error

                                                                                                      command

                                                                                                      npx create-react-app myp --template redux
                                                                                                      

                                                                                                      error

                                                                                                      Installing template dependencies using npm...
                                                                                                      npm ERR! code ERESOLVE
                                                                                                      npm ERR! ERESOLVE unable to resolve dependency tree
                                                                                                      npm ERR!
                                                                                                      npm ERR! While resolving: myp@0.1.0
                                                                                                      npm ERR! Found: react@18.0.0
                                                                                                      npm ERR! node_modules/react
                                                                                                      npm ERR!   react@"^18.0.0" from the root project
                                                                                                      npm ERR!
                                                                                                      npm ERR! Could not resolve dependency:
                                                                                                      npm ERR! peer react@"^16.8.3 || ^17" from react-redux@7.2.6
                                                                                                      npm ERR! node_modules/react-redux
                                                                                                      npm ERR!   react-redux@"^7.2.3" from the root project
                                                                                                      npm ERR!
                                                                                                      npm ERR! Fix the upstream dependency conflict, or retry
                                                                                                      npm ERR! this command with --force, or --legacy-peer-deps
                                                                                                      npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
                                                                                                      npm ERR!
                                                                                                      npm ERR! See C:\Users\rickb\AppData\Local\npm-cache\eresolve-report.txt for a full report.
                                                                                                      
                                                                                                      npm ERR! A complete log of this run can be found in:
                                                                                                      npm ERR!     C:\Users\rickb\AppData\Local\npm-cache\_logs\2022-03-30T18_49_41_783Z-debug-0.log
                                                                                                      `npm install --no-audit --save @reduxjs/toolkit@^1.5.1 @testing-library/jest-dom@^4.2.4 @testing-library/react@^9.3.2 @testing-library/user-event@^7.1.2 react-redux@^7.2.3` failed
                                                                                                      

                                                                                                      What should I do to remove this error??

                                                                                                      ANSWER

                                                                                                      Answered 2022-Mar-31 at 20:50

                                                                                                      It's a new error, and realistically your only solution is to just add react-redux with Yarn.

                                                                                                      yarn add react-redux

                                                                                                      Note: I suggest downgrading your React to version 17 for the time being, Since React v18 is not supporting Redux Toolkit and other Libraries. On my end I am using Redux saga and it is having issues with v18.

                                                                                                      Source https://stackoverflow.com/questions/71682625

                                                                                                      QUESTION

                                                                                                      Invalid options object. Dev Server has been initialized using an options object that does not match the API schema
                                                                                                      Asked 2022-Mar-28 at 21:08

                                                                                                      I have been stock on this error on my project when I add "proxy": "http://localhost:6000" in my package.json.

                                                                                                      This is the error response after yarn start.

                                                                                                      Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.

                                                                                                      • options.allowedHosts[0] should be a non-empty string. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

                                                                                                      But everything is fine when I remove the "proxy": "http://localhost:6000".

                                                                                                      This is on my package.json:

                                                                                                      {
                                                                                                        "name": "client",
                                                                                                        "version": "0.1.0",
                                                                                                        "private": true, 
                                                                                                        "dependencies": {
                                                                                                          "@material-ui/core": "^4.12.3",
                                                                                                          "@testing-library/jest-dom": "^5.16.1",
                                                                                                          "@testing-library/react": "^12.1.2",
                                                                                                          "@testing-library/user-event": "^13.5.0",
                                                                                                          "axios": "^0.24.0",
                                                                                                          "moment": "^2.29.1",
                                                                                                          "react": "^17.0.2",
                                                                                                          "react-dom": "^17.0.2",
                                                                                                          "react-file-base64": "^1.0.3",
                                                                                                          "react-redux": "^7.2.6",
                                                                                                          "react-scripts": "5.0.0",
                                                                                                          "redux": "^4.1.2",
                                                                                                          "redux-thunk": "^2.4.1",
                                                                                                          "web-vitals": "^2.1.2"
                                                                                                        },
                                                                                                        "scripts": {
                                                                                                          "start": "react-scripts start",
                                                                                                          "build": "react-scripts build",
                                                                                                          "test": "react-scripts test",
                                                                                                          "eject": "react-scripts eject"
                                                                                                        },
                                                                                                        "eslintConfig": {
                                                                                                          "extends": [
                                                                                                            "react-app",
                                                                                                            "react-app/jest"
                                                                                                          ]
                                                                                                        },
                                                                                                        "browserslist": {
                                                                                                          "production": [
                                                                                                            ">0.2%",
                                                                                                            "not dead",
                                                                                                            "not op_mini all"
                                                                                                          ],
                                                                                                          "development": [
                                                                                                            "last 1 chrome version",
                                                                                                            "last 1 firefox version",
                                                                                                            "last 1 safari version"
                                                                                                          ]
                                                                                                        },
                                                                                                        "proxy": "http://localhost:6000"
                                                                                                      }
                                                                                                      

                                                                                                      ANSWER

                                                                                                      Answered 2021-Dec-19 at 16:06

                                                                                                      Here is a workaround. Delete "proxy": "http://localhost:6000". Install package http-proxy-middleware with command npm install http-proxy-middleware --save. Create a file setupProxy.js inside your src folder. Add these lines inside:

                                                                                                      const { createProxyMiddleware } = require('http-proxy-middleware');
                                                                                                      
                                                                                                      module.exports = function(app) {
                                                                                                        app.use(
                                                                                                          '/api',
                                                                                                          createProxyMiddleware({
                                                                                                            target: 'http://localhost:6000',
                                                                                                            changeOrigin: true,
                                                                                                          })
                                                                                                        );
                                                                                                      };
                                                                                                      

                                                                                                      Now, run your app. It should work.

                                                                                                      Source https://stackoverflow.com/questions/70374005

                                                                                                      QUESTION

                                                                                                      The unauthenticated git protocol on port 9418 is no longer supported
                                                                                                      Asked 2022-Mar-27 at 13:23

                                                                                                      I have been using github actions for quite sometime but today my deployments started failing. Below is the error from github action logs

                                                                                                      Command: git
                                                                                                      Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
                                                                                                      Directory: /home/runner/work/stackstream-fe/stackstream-fe
                                                                                                      Output:
                                                                                                      fatal: remote error: 
                                                                                                        The unauthenticated git protocol on port 9418 is no longer supported.
                                                                                                      

                                                                                                      Upon investigation, it appears that below section in my yml file is causing the issue.

                                                                                                          - name: Installing modules
                                                                                                            run: yarn install
                                                                                                      

                                                                                                      I have looked into this change log but can't seem to comprehend the issue.

                                                                                                      Additional Details: Server: EC2 Instance Github actions steps:

                                                                                                        steps:
                                                                                                        - name: Checkout
                                                                                                          uses: actions/checkout@v2
                                                                                                      
                                                                                                        - id: vars
                                                                                                          run: |
                                                                                                            if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo "::set-output name=environment::prod_stackstream" ; echo "::set-output name=api-url::api" ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo "::set-output name=environment::staging_stackstream"  ; echo "::set-output name=api-url::stagingapi" ; else echo "::set-output name=environment::dev_stackstream" ; echo "::set-output name=api-url::devapi" ; fi
                                                                                                      
                                                                                                        - uses: pCYSl5EDgo/cat@master
                                                                                                          id: slack
                                                                                                          with:
                                                                                                            path: .github/workflows/slack.txt
                                                                                                      
                                                                                                        - name: Slack Start Notification
                                                                                                          uses: 8398a7/action-slack@v3
                                                                                                          env:
                                                                                                            SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
                                                                                                            ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
                                                                                                            COLOR: good
                                                                                                            STATUS: '`Started`'
                                                                                                          with:
                                                                                                            status: custom
                                                                                                            fields: workflow,job,commit,repo,ref,author,took
                                                                                                            custom_payload: |
                                                                                                              ${{ steps.slack.outputs.text }}
                                                                                                      
                                                                                                        - name: Installing modules
                                                                                                          env:
                                                                                                            REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
                                                                                                          run: yarn install
                                                                                                      
                                                                                                        - name: Create Frontend Build
                                                                                                          env:
                                                                                                            REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
                                                                                                          run: yarn build
                                                                                                      
                                                                                                        - name: Deploy to Frontend Server DEV
                                                                                                          if: ${{ contains(github.ref, 'dev') }}
                                                                                                          uses: easingthemes/ssh-deploy@v2.1.5
                                                                                                          env:
                                                                                                            SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
                                                                                                            ARGS: '-rltgoDzvO --delete'
                                                                                                            SOURCE: 'deploy/'
                                                                                                            REMOTE_HOST: ${{ secrets.DEV_HOST }}
                                                                                                            REMOTE_USER: plyfolio-dev
                                                                                                            TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
                                                                                                      

                                                                                                      package.json file

                                                                                                         {
                                                                                                        "name": "stackstream-fe",
                                                                                                        "version": "1.0.0",
                                                                                                        "authors": [
                                                                                                          "fayyaznofal@gmail.com"
                                                                                                        ],
                                                                                                        "private": true,
                                                                                                        "dependencies": {
                                                                                                          "@fortawesome/fontawesome-svg-core": "^1.2.34",
                                                                                                          "@fortawesome/free-solid-svg-icons": "^5.15.2",
                                                                                                          "@fortawesome/react-fontawesome": "^0.1.14",
                                                                                                          "@fullcalendar/bootstrap": "^5.5.0",
                                                                                                          "@fullcalendar/core": "^5.5.0",
                                                                                                          "@fullcalendar/daygrid": "^5.5.0",
                                                                                                          "@fullcalendar/interaction": "^5.5.0",
                                                                                                          "@fullcalendar/react": "^5.5.0",
                                                                                                          "@lourenci/react-kanban": "^2.1.0",
                                                                                                          "@redux-saga/simple-saga-monitor": "^1.1.2",
                                                                                                          "@testing-library/jest-dom": "^5.11.9",
                                                                                                          "@testing-library/react": "^11.2.3",
                                                                                                          "@testing-library/user-event": "^12.6.0",
                                                                                                          "@toast-ui/react-chart": "^1.0.2",
                                                                                                          "@types/jest": "^26.0.14",
                                                                                                          "@types/node": "^14.10.3",
                                                                                                          "@types/react": "^16.9.49",
                                                                                                          "@types/react-dom": "^16.9.8",
                                                                                                          "@vtaits/react-color-picker": "^0.1.1",
                                                                                                          "apexcharts": "^3.23.1",
                                                                                                          "availity-reactstrap-validation": "^2.7.0",
                                                                                                          "axios": "^0.21.1",
                                                                                                          "axios-mock-adapter": "^1.19.0",
                                                                                                          "axios-progress-bar": "^1.2.0",
                                                                                                          "bootstrap": "^5.0.0-beta2",
                                                                                                          "chart.js": "^2.9.4",
                                                                                                          "chartist": "^0.11.4",
                                                                                                          "classnames": "^2.2.6",
                                                                                                          "components": "^0.1.0",
                                                                                                          "dotenv": "^8.2.0",
                                                                                                          "draft-js": "^0.11.7",
                                                                                                          "echarts": "^4.9.0",
                                                                                                          "echarts-for-react": "^2.0.16",
                                                                                                          "firebase": "^8.2.3",
                                                                                                          "google-maps-react": "^2.0.6",
                                                                                                          "history": "^4.10.1",
                                                                                                          "i": "^0.3.6",
                                                                                                          "i18next": "^19.8.4",
                                                                                                          "i18next-browser-languagedetector": "^6.0.1",
                                                                                                          "jsonwebtoken": "^8.5.1",
                                                                                                          "leaflet": "^1.7.1",
                                                                                                          "lodash": "^4.17.21",
                                                                                                          "lodash.clonedeep": "^4.5.0",
                                                                                                          "lodash.get": "^4.4.2",
                                                                                                          "metismenujs": "^1.2.1",
                                                                                                          "mkdirp": "^1.0.4",
                                                                                                          "moment": "2.29.1",
                                                                                                          "moment-timezone": "^0.5.32",
                                                                                                          "nouislider-react": "^3.3.9",
                                                                                                          "npm": "^7.6.3",
                                                                                                          "prop-types": "^15.7.2",
                                                                                                          "query-string": "^6.14.0",
                                                                                                          "react": "^16.13.1",
                                                                                                          "react-apexcharts": "^1.3.7",
                                                                                                          "react-auth-code-input": "^1.0.0",
                                                                                                          "react-avatar": "^3.10.0",
                                                                                                          "react-bootstrap": "^1.5.0",
                                                                                                          "react-bootstrap-editable": "^0.8.2",
                                                                                                          "react-bootstrap-sweetalert": "^5.2.0",
                                                                                                          "react-bootstrap-table-next": "^4.0.3",
                                                                                                          "react-bootstrap-table2-editor": "^1.4.0",
                                                                                                          "react-bootstrap-table2-paginator": "^2.1.2",
                                                                                                          "react-bootstrap-table2-toolkit": "^2.1.3",
                                                                                                          "react-chartist": "^0.14.3",
                                                                                                          "react-chartjs-2": "^2.11.1",
                                                                                                          "react-color": "^2.19.3",
                                                                                                          "react-confirm-alert": "^2.7.0",
                                                                                                          "react-content-loader": "^6.0.1",
                                                                                                          "react-countdown": "^2.3.1",
                                                                                                          "react-countup": "^4.3.3",
                                                                                                          "react-cropper": "^2.1.4",
                                                                                                          "react-data-table-component": "^6.11.8",
                                                                                                          "react-date-picker": "^8.0.6",
                                                                                                          "react-datepicker": "^3.4.1",
                                                                                                          "react-dom": "^16.13.1",
                                                                                                          "react-draft-wysiwyg": "^1.14.5",
                                                                                                          "react-drag-listview": "^0.1.8",
                                                                                                          "react-drawer": "^1.3.4",
                                                                                                          "react-dropzone": "^11.2.4",
                                                                                                          "react-dual-listbox": "^2.0.0",
                                                                                                          "react-facebook-login": "^4.1.1",
                                                                                                          "react-flatpickr": "^3.10.6",
                                                                                                          "react-google-login": "^5.2.2",
                                                                                                          "react-hook-form": "^7.15.2",
                                                                                                          "react-i18next": "^11.8.5",
                                                                                                          "react-icons": "^4.2.0",
                                                                                                          "react-image-lightbox": "^5.1.1",
                                                                                                          "react-input-mask": "^2.0.4",
                                                                                                          "react-jvectormap": "^0.0.16",
                                                                                                          "react-leaflet": "^3.0.5",
                                                                                                          "react-meta-tags": "^1.0.1",
                                                                                                          "react-modal-video": "^1.2.6",
                                                                                                          "react-notifications": "^1.7.2",
                                                                                                          "react-number-format": "^4.7.3",
                                                                                                          "react-perfect-scrollbar": "^1.5.8",
                                                                                                          "react-rangeslider": "^2.2.0",
                                                                                                          "react-rating": "^2.0.5",
                                                                                                          "react-rating-tooltip": "^1.1.6",
                                                                                                          "react-redux": "^7.2.1",
                                                                                                          "react-responsive-carousel": "^3.2.11",
                                                                                                          "react-router-dom": "^5.2.0",
                                                                                                          "react-script": "^2.0.5",
                                                                                                          "react-scripts": "3.4.3",
                                                                                                          "react-select": "^4.3.1",
                                                                                                          "react-sparklines": "^1.7.0",
                                                                                                          "react-star-ratings": "^2.3.0",
                                                                                                          "react-super-responsive-table": "^5.2.0",
                                                                                                          "react-switch": "^6.0.0",
                                                                                                          "react-table": "^7.6.3",
                                                                                                          "react-toastify": "^7.0.3",
                                                                                                          "react-toastr": "^3.0.0",
                                                                                                          "react-twitter-auth": "0.0.13",
                                                                                                          "reactstrap": "^8.8.1",
                                                                                                          "recharts": "^2.0.8",
                                                                                                          "redux": "^4.0.5",
                                                                                                          "redux-saga": "^1.1.3",
                                                                                                          "reselect": "^4.0.0",
                                                                                                          "sass": "^1.37.5",
                                                                                                          "simplebar-react": "^2.3.0",
                                                                                                          "styled": "^1.0.0",
                                                                                                          "styled-components": "^5.2.1",
                                                                                                          "toastr": "^2.1.4",
                                                                                                          "typescript": "^4.0.2",
                                                                                                          "universal-cookie": "^4.0.4"
                                                                                                        },
                                                                                                        "devDependencies": {
                                                                                                          "@typescript-eslint/eslint-plugin": "^2.27.0",
                                                                                                          "@typescript-eslint/parser": "^2.27.0",
                                                                                                          "@typescript-eslint/typescript-estree": "^4.15.2",
                                                                                                          "eslint-config-prettier": "^6.10.1",
                                                                                                          "eslint-plugin-prettier": "^3.1.2",
                                                                                                          "husky": "^4.2.5",
                                                                                                          "lint-staged": "^10.1.3",
                                                                                                          "prettier": "^1.19.1",
                                                                                                          "react-test-renderer": "^16.13.1",
                                                                                                          "redux-devtools-extension": "^2.13.8",
                                                                                                          "redux-mock-store": "^1.5.4"
                                                                                                        },
                                                                                                        "scripts": {
                                                                                                          "start": "react-scripts start",
                                                                                                          "build": "react-scripts build && mv build ./deploy/build",
                                                                                                          "build-local": "react-scripts build",
                                                                                                          "test": "react-scripts test",
                                                                                                          "eject": "react-scripts eject"
                                                                                                        },
                                                                                                        "eslintConfig": {
                                                                                                          "extends": "react-app"
                                                                                                        },
                                                                                                        "husky": {
                                                                                                          "hooks": {
                                                                                                            "pre-commit": "lint-staged"
                                                                                                          }
                                                                                                        },
                                                                                                        "lint-staged": {
                                                                                                          "*.{js,ts,tsx}": [
                                                                                                            "eslint --fix"
                                                                                                          ]
                                                                                                        },
                                                                                                        "browserslist": {
                                                                                                          "production": [
                                                                                                            ">0.2%",
                                                                                                            "not dead",
                                                                                                            "not op_mini all"
                                                                                                          ],
                                                                                                          "development": [
                                                                                                            "last 1 chrome version",
                                                                                                            "last 1 firefox version",
                                                                                                            "last 1 safari version"
                                                                                                          ]
                                                                                                        }
                                                                                                      }
                                                                                                      

                                                                                                      ANSWER

                                                                                                      Answered 2022-Mar-16 at 07:01

                                                                                                      First, this error message is indeed expected on Jan. 11th, 2022.
                                                                                                      See "Improving Git protocol security on GitHub".

                                                                                                      January 11, 2022 Final brownout.

                                                                                                      This is the full brownout period where we’ll temporarily stop accepting the deprecated key and signature types, ciphers, and MACs, and the unencrypted Git protocol.
                                                                                                      This will help clients discover any lingering use of older keys or old URLs.

                                                                                                      Second, check your package.json dependencies for any git:// URL, as in this example, fixed in this PR.

                                                                                                      As noted by Jörg W Mittag:

                                                                                                      There was a 4-month warning.
                                                                                                      The entire Internet has been moving away from unauthenticated, unencrypted protocols for a decade, it's not like this is a huge surprise.

                                                                                                      Personally, I consider it less an "issue" and more "detecting unmaintained dependencies".

                                                                                                      Plus, this is still only the brownout period, so the protocol will only be disabled for a short period of time, allowing developers to discover the problem.

                                                                                                      The permanent shutdown is not until March 15th.

                                                                                                      For GitHub Actions:

                                                                                                      As in actions/checkout issue 14, you can add as a first step:

                                                                                                          - name: Fix up git URLs
                                                                                                            run: echo -e '[url "https://github.com/"]\n  insteadOf = "git://github.com/"' >> ~/.gitconfig
                                                                                                      

                                                                                                      That will change any git://github.com/ into https://github.com/.

                                                                                                      For local projects

                                                                                                      For all your repositories, you can set:

                                                                                                      git config --global url."https://github.com/".insteadOf git://github.com/
                                                                                                      

                                                                                                      You can also use SSH, but GitHub Security reminds us that, as of March 15th, 2022, GitHub stopped accepting DSA keys. RSA keys uploaded after Nov 2, 2021 will work only with SHA-2 signatures.
                                                                                                      The deprecated MACs, ciphers, and unencrypted Git protocol are permanently disabled.

                                                                                                      So this (with the right key) would work:

                                                                                                      git config --global url."git@github.com:".insteadOf git://github.com/
                                                                                                      

                                                                                                      That will change any git://github.com/ (unencrypted Git protocol) into git@github.com: (SSH URL).

                                                                                                      Source https://stackoverflow.com/questions/70663523

                                                                                                      QUESTION

                                                                                                      Consider using the "jsdom" test environment
                                                                                                      Asked 2022-Mar-23 at 20:23

                                                                                                      I have this simple test:

                                                                                                      import React from 'react'
                                                                                                      import { render } from '@testing-library/react'
                                                                                                      
                                                                                                      import Button from '.'
                                                                                                      
                                                                                                      describe('Button', () => {
                                                                                                        it('renders button without crashing', () => {
                                                                                                          const label = 'test'
                                                                                                      
                                                                                                          render()
                                                                                                        })
                                                                                                      })
                                                                                                      
                                                                                                      

                                                                                                      And I have a jest.config.json with this content

                                                                                                      {
                                                                                                        "setupFilesAfterEnv": [
                                                                                                          "/lib/settings/setupTests.ts"
                                                                                                        ]
                                                                                                      }
                                                                                                      

                                                                                                      And on my setupTests.ts I have

                                                                                                      import '@testing-library/jest-dom'
                                                                                                      

                                                                                                      When I run npm run test (which just run jest), I got the following error:

                                                                                                      The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.

                                                                                                      Consider using the "jsdom" test environment.

                                                                                                      What I am doing wrong? This used to work before an upgrade.

                                                                                                      ANSWER

                                                                                                      Answered 2021-Oct-25 at 05:17

                                                                                                      In your package.json, or jest.config.js/jest.config.js, change the value of the testEnvironment property to jsdom.

                                                                                                      Package.json
                                                                                                      "jest":{
                                                                                                          "testEnvironment": "jsdom"
                                                                                                      }
                                                                                                      
                                                                                                      jest.config.[js|ts]
                                                                                                      {
                                                                                                          "testEnvironment": "jsdom"
                                                                                                      }
                                                                                                      
                                                                                                      Why?

                                                                                                      By default, jest uses the node testEnvironment. This essentially makes any tests meant for a browser environment invalid.

                                                                                                      jsdom is an implementation of a browser environment, which supports these types of UI tests.

                                                                                                      Additional reading

                                                                                                      jest testEnvironment documentation

                                                                                                      Source https://stackoverflow.com/questions/69227566

                                                                                                      QUESTION

                                                                                                      Sign-in page wont show up
                                                                                                      Asked 2022-Mar-13 at 20:29

                                                                                                      I'm trying to make a Sign-In page & the Sign-In form has disappeared. It isn't rendering like it should on the DOM anymore. I think it has to do with my import {useState} from 'react'. Everything was working fine until I included the {useState} hook. I am getting the following error message:

                                                                                                      react.development.js:1476 Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component.

                                                                                                      Im not sure where I went wrong. Any suggestions?

                                                                                                      import { useState } from 'react';
                                                                                                      import { useForm } from 'react-hook-form';
                                                                                                      import './App.css';
                                                                                                      
                                                                                                      function App() {
                                                                                                        const { register, handleSubmit, errors } = useForm();
                                                                                                        const [userInfo, setUserInfo] = useState();
                                                                                                        const onSubmit = (data) => {
                                                                                                          setUserInfo(data);
                                                                                                          console.log(data);
                                                                                                        };
                                                                                                        console.log(errors);
                                                                                                      
                                                                                                        return (
                                                                                                          
                                                                                                            
                                                                                                      {JSON.stringify(userInfo, undefined, 2)}
                                                                                                      Registration Form Username

                                                                                                      {errors.username?.message}

                                                                                                      Email

                                                                                                      {errors.email?.message}

                                                                                                      Password

                                                                                                      {errors.password?.message}

                                                                                                      Submit ); } export default App; *************. INDEX.JS. ************** import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; ReactDOM.render( , document.getElementById('root') ); ********** PACKAGE.JSON ****************** { "name": "my-form", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.16.2", "@testing-library/react": "^12.1.3", "@testing-library/user-event": "^13.5.0", "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": "5.0.0", "web-vitals": "^2.1.4" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }

                                                                                                      ANSWER

                                                                                                      Answered 2022-Mar-13 at 03:21

                                                                                                      The problems I found during implementing it in this codesandbox are in react-hook-form. I don't know which version of the react-hook-form but the way you are calling ref={register({required:true})} is not same as the docs. In docs, it is calling the register function like below:

                                                                                                      
                                                                                                      

                                                                                                      I'm sure you can configure it more according to the docs.

                                                                                                      And another one is the errors from the useForm hook. In the docs, it is calling it like below:

                                                                                                        const {
                                                                                                          register,
                                                                                                          handleSubmit,
                                                                                                          formState:{errors}
                                                                                                        } = useForm();
                                                                                                      

                                                                                                      useForm is returning a formState object which contains errors. Please check this one.

                                                                                                      I hope the above Codesandbox will help you. Thank you.

                                                                                                      Source https://stackoverflow.com/questions/71453158

                                                                                                      QUESTION

                                                                                                      Switch' is not exported from 'react-router-dom'
                                                                                                      Asked 2022-Mar-01 at 09:07

                                                                                                      In package.json file react-router-dom dependencies added. App component wrapped by BrowswerRouter , but when I wrap route by switch it says the following error Switch' is not exported from 'react-router-dom'. I deleted the package.json.lock ,node modules, installed npm again and npm install @babel/core --save. Still not working. I successfully wasted 6 hour for this. Can you please help me to fix this? why it's not importing?

                                                                                                      Index.js

                                                                                                      import {BrowserRouter} from 'react-router-dom';
                                                                                                      
                                                                                                      ReactDOM.render(
                                                                                                        
                                                                                                           
                                                                                                        ,
                                                                                                        document.getElementById('root')
                                                                                                      );
                                                                                                      

                                                                                                      App.js:

                                                                                                       import logo from './logo.svg';
                                                                                                      import './App.css';
                                                                                                      import React from 'react';
                                                                                                      import {Switch,Route,Link} from 'react-router-dom';
                                                                                                      import Home from './Home';
                                                                                                      class App extends React.Component {
                                                                                                        componentDidMount(){
                                                                                                          alert('mounting');
                                                                                                        }
                                                                                                        componentDidUpdate(){
                                                                                                          alert('updated');
                                                                                                        }
                                                                                                       render(){
                                                                                                        return (
                                                                                                          
                                                                                                          
                                                                                                           
                                                                                                          
                                                                                                            Home
                                                                                                          
                                                                                                      
                                                                                                          
                                                                                                      
                                                                                                          
                                                                                                            
                                                                                                              
                                                                                                            
                                                                                                          
                                                                                                       
                                                                                                        
                                                                                                       
                                                                                                      );
                                                                                                       }
                                                                                                      }
                                                                                                      
                                                                                                      export default App;
                                                                                                      
                                                                                                      import React from 'react';
                                                                                                      
                                                                                                          const Home = () => {
                                                                                                          return Home;
                                                                                                        };
                                                                                                        
                                                                                                        export default Home;
                                                                                                      

                                                                                                      package.json

                                                                                                      "dependencies": {
                                                                                                          "@babel/core": "^7.16.0",
                                                                                                          "@testing-library/jest-dom": "^5.11.4",
                                                                                                          "@testing-library/react": "^11.1.0",
                                                                                                          "@testing-library/user-event": "^12.1.10",
                                                                                                          "react": "^17.0.2",
                                                                                                          "react-dom": "^17.0.2",
                                                                                                          "react-router": "^6.0.0",
                                                                                                          "react-router-dom": "^6.0.0",
                                                                                                          "react-scripts": "4.0.3",
                                                                                                          "web-vitals": "^1.0.1"
                                                                                                        },
                                                                                                      

                                                                                                      ANSWER

                                                                                                      Answered 2021-Nov-04 at 18:10
                                                                                                      Using Routes instead of Switch in react-router v6

                                                                                                      You are using react-router-dom version 6, which replaced Switch with the Routes component

                                                                                                      import {
                                                                                                        BrowserRouter,
                                                                                                        Routes, // instead of "Switch"
                                                                                                        Route,
                                                                                                      } from "react-router-dom";
                                                                                                      
                                                                                                      // ...
                                                                                                      
                                                                                                          
                                                                                                            
                                                                                                              }>
                                                                                                                
                                                                                                              
                                                                                                            
                                                                                                          
                                                                                                      

                                                                                                      Note that you now also pass your component as the element prop instead of using children.

                                                                                                      Source https://stackoverflow.com/questions/69843615

                                                                                                      QUESTION

                                                                                                      Module not found: Error: Can't resolve 'date-fns/addDays' in 'C:\Users\
                                                                                                      Asked 2022-Feb-08 at 17:19

                                                                                                      I want to use Date picker from MUI but I get this error and I don't know what exactly is wrong. here is my code:

                                                                                                      import TextField from "@mui/material/TextField";
                                                                                                      import DatePicker from "@mui/lab/DatePicker";
                                                                                                      import AdapterDateFns from "@mui/lab/AdapterDateFns";
                                                                                                      import LocalizationProvider from "@mui/lab/LocalizationProvider";
                                                                                                      
                                                                                                      const ExpenseForm = () => {
                                                                                                        return (
                                                                                                          
                                                                                                            
                                                                                                               {}}
                                                                                                                renderInput={(params) => }
                                                                                                              />
                                                                                                            
                                                                                                          
                                                                                                        );
                                                                                                      };
                                                                                                      
                                                                                                      export default ExpenseForm;
                                                                                                      

                                                                                                      and my package.json:

                                                                                                      "dependencies": {
                                                                                                          "@date-io/date-fns": "^2.13.1",
                                                                                                          "@emotion/react": "^11.7.1",
                                                                                                          "@emotion/styled": "^11.6.0",
                                                                                                          "@mui/icons-material": "^5.3.1",
                                                                                                          "@mui/lab": "^5.0.0-alpha.68",
                                                                                                          "@mui/material": "^5.4.0",
                                                                                                          "@testing-library/jest-dom": "^5.16.1",
                                                                                                          "@testing-library/react": "^12.1.2",
                                                                                                          "@testing-library/user-event": "^13.5.0",
                                                                                                          "react": "^17.0.2",
                                                                                                          "react-dom": "^17.0.2",
                                                                                                          "react-scripts": "5.0.0",
                                                                                                          "web-vitals": "^2.1.4"
                                                                                                        },
                                                                                                      

                                                                                                      but everytime I get these errors:

                                                                                                      Compiled with problems:
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 1:0-39
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/addDays' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 2:0-45
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/addSeconds' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 3:0-45
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/addMinutes' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 4:0-41
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/addHours' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 5:0-41
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/addWeeks' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 6:0-43
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/addMonths' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 7:0-41
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/addYears' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 8:0-59
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/differenceInYears' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 9:0-65
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/differenceInQuarters' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 10:0-61
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/differenceInMonths' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 11:0-59
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/differenceInWeeks' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 12:0-57
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/differenceInDays' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 13:0-59
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/differenceInHours' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 14:0-63
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/differenceInMinutes' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 15:0-63
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/differenceInSeconds' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 16:0-73
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/differenceInMilliseconds' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 17:0-59
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/eachDayOfInterval' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 18:0-41
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/endOfDay' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 19:0-43
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/endOfWeek' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 20:0-43
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/endOfYear' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 21:0-37
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/format' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 22:0-41
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/getHours' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 23:0-45
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/getSeconds' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 24:0-39
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/getYear' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 25:0-39
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/isAfter' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 26:0-41
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/isBefore' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 27:0-39
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/isEqual' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 28:0-43
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/isSameDay' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 29:0-45
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/isSameYear' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 30:0-47
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/isSameMonth' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 31:0-45
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/isSameHour' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 32:0-39
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/isValid' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 33:0-42
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/parse' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 34:0-41
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/setHours' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 35:0-45
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/setMinutes' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 36:0-41
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/setMonth' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 37:0-37
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/getDay' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 38:0-53
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/getDaysInMonth' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 39:0-45
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/setSeconds' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 40:0-39
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/setYear' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 41:0-45
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/startOfDay' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 42:0-49
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/startOfMonth' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 43:0-45
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/endOfMonth' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 44:0-47
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/startOfWeek' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 45:0-47
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/startOfYear' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 46:0-41
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/parseISO' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 47:0-43
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/formatISO' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 48:0-57
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/isWithinInterval' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 49:0-65
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/_lib/format/longFormatters' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      
                                                                                                      
                                                                                                      ERROR in ./node_modules/@date-io/date-fns/build/index.esm.js 50:0-50
                                                                                                      
                                                                                                      Module not found: Error: Can't resolve 'date-fns/locale/en-US' in 'C:\Users\Amir\Desktop\React\React-apps\expense-tracker\node_modules\@date-io\date-fns\build'
                                                                                                      

                                                                                                      I searched the web but couldn't find something useful . also some StackOverflow similar posts that suggested to restart the server I tried but didn't actually solve my problem.

                                                                                                      ANSWER

                                                                                                      Answered 2022-Feb-08 at 17:19

                                                                                                      You need to install the date-fns package from NPM using npm install --save date-fns.

                                                                                                      Source https://stackoverflow.com/questions/71037974

                                                                                                      QUESTION

                                                                                                      NPM CI error bindings not accessible from watchpack-chokidar2:fsevents
                                                                                                      Asked 2022-Feb-02 at 12:53

                                                                                                      When I run npm ci on Github Actions I got the error:

                                                                                                      Run npm ci
                                                                                                      npm ERR! bindings not accessible from watchpack-chokidar2:fsevents
                                                                                                      
                                                                                                      npm ERR! A complete log of this run can be found in:
                                                                                                      npm ERR!     /home/runner/.npm/_logs/2021-09-17T15_18_42_465Z-debug.log
                                                                                                      Error: Process completed with exit code 1.
                                                                                                      

                                                                                                      What can be?

                                                                                                      My .github/workflows/eslint.yaml

                                                                                                      name: ESLint
                                                                                                      
                                                                                                      on: [push, pull_request]
                                                                                                      
                                                                                                      jobs:
                                                                                                        build:
                                                                                                          runs-on: ubuntu-latest
                                                                                                          steps:
                                                                                                            - uses: actions/checkout@v2
                                                                                                            - name: Use Node.js
                                                                                                              uses: actions/setup-node@v1
                                                                                                              with:
                                                                                                                node-version: '14.x'
                                                                                                            - run: npm ci
                                                                                                            - run: npm run lint
                                                                                                      

                                                                                                      My package.json

                                                                                                      {
                                                                                                        "name": "@blinktrade/uikit",
                                                                                                        "version": "1.0.0",
                                                                                                        "main": "dist/index.js",
                                                                                                        "license": "MIT",
                                                                                                        "devDependencies": {
                                                                                                          "@babel/plugin-transform-react-jsx": "^7.14.9",
                                                                                                          "@babel/preset-env": "^7.15.6",
                                                                                                          "@babel/preset-react": "^7.14.5",
                                                                                                          "@babel/preset-typescript": "^7.15.0",
                                                                                                          "@storybook/addon-essentials": "^6.3.8",
                                                                                                          "@storybook/react": "^6.3.8",
                                                                                                          "@testing-library/jest-dom": "^5.14.1",
                                                                                                          "@testing-library/react": "^12.1.0",
                                                                                                          "@testing-library/user-event": "^13.2.1",
                                                                                                          "@types/jest": "^27.0.1",
                                                                                                          "@types/react": "^17.0.21",
                                                                                                          "@typescript-eslint/eslint-plugin": "^4.31.1",
                                                                                                          "@typescript-eslint/parser": "^4.31.1",
                                                                                                          "eslint": "^7.32.0",
                                                                                                          "eslint-plugin-react": "^7.25.2",
                                                                                                          "husky": "^7.0.2",
                                                                                                          "jest": "^27.2.0",
                                                                                                          "prettier": "^2.4.1",
                                                                                                          "pretty-quick": "^3.1.1",
                                                                                                          "react": "^17.0.2",
                                                                                                          "react-dom": "^17.0.2",
                                                                                                          "rimraf": "^3.0.2",
                                                                                                          "typescript": "^4.4.3"
                                                                                                        },
                                                                                                        "husky": {
                                                                                                          "hooks": {
                                                                                                            "pre-push": "npm run lint",
                                                                                                            "pre-commit": "pretty-quick --staged"
                                                                                                          }
                                                                                                        },
                                                                                                        "scripts": {
                                                                                                          "build": "tsc -p .",
                                                                                                          "clear": "rimraf dist/",
                                                                                                          "format": "prettier '**/*' --write --ignore-unknown",
                                                                                                          "lint": "eslint --max-warnings=0 .",
                                                                                                          "storybook": "start-storybook -p 4000",
                                                                                                          "test": "jest"
                                                                                                        }
                                                                                                      }
                                                                                                      

                                                                                                      ANSWER

                                                                                                      Answered 2021-Sep-20 at 20:57

                                                                                                      Solved removing packages-lock.json and running again using NodeJS 14 (was 10)

                                                                                                      Source https://stackoverflow.com/questions/69225852

                                                                                                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                                                                                                      Vulnerabilities

                                                                                                      No vulnerabilities reported

                                                                                                      Install jest-dom

                                                                                                      This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:. for installation with yarn package manager. Note: We also recommend installing the jest-dom eslint plugin which provides auto-fixable lint rules that prevent false positive tests and improve test readability by ensuring you are using the right matchers in your tests. More details can be found at eslint-plugin-jest-dom.

                                                                                                      Support

                                                                                                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
                                                                                                      Find more information at:
                                                                                                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                                      Find more libraries
                                                                                                      Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                                      Save this library and start creating your kit
                                                                                                      CLONE
                                                                                                    • HTTPS

                                                                                                      https://github.com/testing-library/jest-dom.git

                                                                                                    • CLI

                                                                                                      gh repo clone testing-library/jest-dom

                                                                                                    • sshUrl

                                                                                                      git@github.com:testing-library/jest-dom.git

                                                                                                    • Share this Page

                                                                                                      share link

                                                                                                      Explore Related Topics

                                                                                                      Consider Popular Testing Libraries

                                                                                                      Try Top Libraries by testing-library

                                                                                                      react-testing-library

                                                                                                      by testing-libraryJavaScript

                                                                                                      react-hooks-testing-library

                                                                                                      by testing-libraryTypeScript

                                                                                                      dom-testing-library

                                                                                                      by testing-libraryJavaScript

                                                                                                      user-event

                                                                                                      by testing-libraryTypeScript

                                                                                                      cypress-testing-library

                                                                                                      by testing-libraryJavaScript

                                                                                                      Compare Testing Libraries with Highest Support

                                                                                                      jest

                                                                                                      by facebook

                                                                                                      cypress

                                                                                                      by cypress-io

                                                                                                      pitest

                                                                                                      by hcoles

                                                                                                      testcafe

                                                                                                      by DevExpress

                                                                                                      dom-testing-library

                                                                                                      by testing-library

                                                                                                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                                      Find more libraries
                                                                                                      Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                                      Save this library and start creating your kit