Fix resolution of files for Jest

pull/21833/head
Travis Ralston 2020-01-09 17:22:21 -07:00
parent 0e8af15b9c
commit ffd037dfa8
2 changed files with 16 additions and 2 deletions

10
__mocks__/languages.json Normal file
View File

@ -0,0 +1,10 @@
{
"en": {
"fileName": "en_EN.json",
"label": "English"
},
"en-us": {
"fileName": "en_US.json",
"label": "English (US)"
}
}

View File

@ -161,7 +161,11 @@
], ],
"setupTestFrameworkScriptFile": "<rootDir>/test/setupTests.js", "setupTestFrameworkScriptFile": "<rootDir>/test/setupTests.js",
"moduleNameMapper": { "moduleNameMapper": {
"\\.(gif|png|svg|ttf|woff2)$": "<rootDir>/__mocks__/imageMock.js" "\\.(gif|png|svg|ttf|woff2)$": "<rootDir>/__mocks__/imageMock.js",
} "\\$webapp/i18n/languages.json": "<rootDir>/__mocks__/languages.json"
},
"transformIgnorePatterns": [
"/node_modules/(?!matrix-js-sdk).+$"
]
} }
} }