Skip to content

Instantly share code, notes, and snippets.

@richardkall
Last active May 26, 2019 16:23
Show Gist options
  • Save richardkall/8eff568181bb14fae8a680ccf84bb526 to your computer and use it in GitHub Desktop.
Save richardkall/8eff568181bb14fae8a680ccf84bb526 to your computer and use it in GitHub Desktop.
Jest SVG and CSS modules mocks
declare module '*.svg' {
const content: any;
export default content;
}
declare module '*.css' {
const classNames: { [className: string]: string };
export default classNames;
}
module.exports = {
moduleNameMapper: {
'\\.svg': '<rootDir>/__mocks__/svgMock.js',
'\\.css': 'identity-obj-proxy',
},
};
module.exports = 'svg-file';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment