Skip to content

Commit 0cfed29

Browse files
Gabe Pinheirofdaciuk
Gabe Pinheiro
authored andcommitted
remove 'svg' in assetsKey, include new expression in 'moduleNameMapper' and 'transform'
1 parent 7b63bd5 commit 0cfed29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jest.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* https://jestjs.io/docs/configuration
44
*/
55

6-
const assetsKey = '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|css)$'
6+
const assetsKey = '\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|css)$'
77

88
const config = {
99
// All imported modules in your tests should be mocked automatically
@@ -85,6 +85,7 @@ const config = {
8585
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
8686
moduleNameMapper: {
8787
'@/(.*)': '<rootDir>/src/$1',
88+
'\\.svg$': '<rootDir>/src/config/tests/mocks/svg.ts',
8889
[assetsKey]: 'ts-jest',
8990
},
9091

@@ -178,6 +179,7 @@ const config = {
178179
transform: {
179180
'^.+\\.tsx?$': 'ts-jest',
180181
[assetsKey]: 'ts-jest',
182+
'\\.svg$': 'ts-jest',
181183
},
182184

183185
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation

0 commit comments

Comments
 (0)