Last active
May 26, 2019 16:23
-
-
Save richardkall/8eff568181bb14fae8a680ccf84bb526 to your computer and use it in GitHub Desktop.
Jest SVG and CSS modules mocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module '*.svg' { | |
const content: any; | |
export default content; | |
} | |
declare module '*.css' { | |
const classNames: { [className: string]: string }; | |
export default classNames; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
moduleNameMapper: { | |
'\\.svg': '<rootDir>/__mocks__/svgMock.js', | |
'\\.css': 'identity-obj-proxy', | |
}, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = 'svg-file'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment