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
Test is failing every time because static resources, such as .png, can not be imported properly in Jest. For example, in the build pipeline, one can see the error message
Test suite failed to run
Configuration error:
Could not locate module ../../assets/images/hyf-logo.png mapped as:
/Users/wwang/Guide-IT/__mocks__/fileMock.js.
Please check your configuration for these entries:
{
"moduleNameMapper": {
"/\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$/": "/Users/wwang/Guide-IT/__mocks__/fileMock.js"
},
"resolver": null
}
To address the issue, mockFile.js need to be created.
Test is failing every time because static resources, such as .png, can not be imported properly in Jest. For example, in the build pipeline, one can see the error message
To address the issue,
mockFile.js
need to be created.jestjs/jest#2663
https://stackoverflow.com/questions/46898638/importing-images-breaks-jest-test
Acceptance criteria
Mock the static files properly, so the mentioned error message is gone.
The text was updated successfully, but these errors were encountered: