mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-22 16:18:14 +08:00
Jest mock for svgr icons (#7941)
* add svg mock Signed-off-by: Kerry Archibald <kerrya@element.io> * use same mock string as imageMock Signed-off-by: Kerry Archibald <kerrya@element.io> * newline Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
26216ec527
commit
547144a565
2
__mocks__/svg.js
Normal file
2
__mocks__/svg.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export const Icon = 'div';
|
||||||
|
export default "image-file-stub";
|
@ -214,7 +214,8 @@
|
|||||||
"<rootDir>/test/setupTests.js"
|
"<rootDir>/test/setupTests.js"
|
||||||
],
|
],
|
||||||
"moduleNameMapper": {
|
"moduleNameMapper": {
|
||||||
"\\.(gif|png|svg|ttf|woff2)$": "<rootDir>/__mocks__/imageMock.js",
|
"\\.(gif|png|ttf|woff2)$": "<rootDir>/__mocks__/imageMock.js",
|
||||||
|
"\\.svg$": "<rootDir>/__mocks__/svg.js",
|
||||||
"\\$webapp/i18n/languages.json": "<rootDir>/__mocks__/languages.json",
|
"\\$webapp/i18n/languages.json": "<rootDir>/__mocks__/languages.json",
|
||||||
"decoderWorker\\.min\\.js": "<rootDir>/__mocks__/empty.js",
|
"decoderWorker\\.min\\.js": "<rootDir>/__mocks__/empty.js",
|
||||||
"decoderWorker\\.min\\.wasm": "<rootDir>/__mocks__/empty.js",
|
"decoderWorker\\.min\\.wasm": "<rootDir>/__mocks__/empty.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user