You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use the Webpack feature to import an asset (CSS/images) from a scoped npm module then Jest will treat the asset as JS code and the test will fail.
importlogofrom'@myscope/my-component/logo.png'
Results in an error like this:
FAIL src\App.test.js
● Test suite failed to run
C:\Users\<user>\Projects\my-app\node_modules\@myscope\my-component\logo.png:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){�PNG
^
SyntaxError: Unexpected token ILLEGAL
at transformAndBuildScript (node_modules\react-scripts\node_modules\jest-runtime\build\transform.js:284:10)
at Object.<anonymous> (src\App.js:3:38)
at Object.<anonymous> (src\App.test.js:3:38)
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
I reported this in create-react-app:
facebook/create-react-app#579
If you use the Webpack feature to import an asset (CSS/images) from a scoped npm module then Jest will treat the asset as JS code and the test will fail.
Results in an error like this:
The text was updated successfully, but these errors were encountered: