What are you trying to achieve? Please describe.
Run a test that loads a pdf from local file in a CRA app.
Describe solutions you've tried
I have tried putting the following at the top of my unit test file
import { pdfjs } from 'react-pdf';
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.min.js`;
but i get the following error
setting up fake worker failed: "Cannot find module '//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.5.207/pdf.worker.min.js' from '../../node_modules/pdfjs-dist/build/pdf.js'".
Environment
"react-scripts": "^4.0.1",
"react-pdf": "^5.1.0",
"react": "^17.0.1",
What are you trying to achieve? Please describe.
Run a test that loads a pdf from local file in a CRA app.
Describe solutions you've tried
I have tried putting the following at the top of my unit test file
but i get the following error
Environment
"react-scripts": "^4.0.1",
"react-pdf": "^5.1.0",
"react": "^17.0.1",