0

I am trying to run test in ReactJS project, it is working fine but as soon as I include

import ReactOwlCarousel from 'react-owl-carousel';

I get following error

FAIL  src/App.test.js Test suite failed to run

TypeError: Cannot read properties of undefined (reading 'fn')


>  8 | import ReactOwlCarousel from 'react-owl-carousel';
     | ^
   

  at node_modules/react-owl-carousel/umd/OwlCarousel.js:1758:8
  at node_modules/react-owl-carousel/umd/OwlCarousel.js:1795:7
  at node_modules/react-owl-carousel/umd/OwlCarousel.js:2:85
  at Object.<anonymous> (node_modules/react-owl-carousel/umd/OwlCarousel.js:5:2)
  at Object.<anonymous> (src/App.js:8:1)
  at Object.<anonymous> (src/App.test.js:2:1)
  at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
  at runJest (node_modules/@jest/core/build/runJest.js:404:19)

 Test Suites: 1 failed, 1 total
 Tests:       0 total
 Snapshots:   0 total
 Time:        0.424 s

I have tried adding adding

<script src="https://code.jquery.com/jquery-3.7.0.slim.min.js"></script>

in index.html but still getting same error

Any type of help is appreciated!

1 Answer 1

0

import OwlCarousel from 'react-owl-carousel'; https://www.npmjs.com/package/react-owl-carousel

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks @Amir kian, it was working fine in the website but was getting the issue in test cases. I just replaced it with another Slider and it is working fine now

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.