diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-12-31 17:34:57 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-12-31 17:34:57 +0100 |
commit | f3cbba49979d417f4d3e2b830f7c58ac90aa55a1 (patch) | |
tree | 5a46656b7df5089cef6ffde645399a8679d87612 /config | |
parent | docs: Document test runner commands (diff) | |
download | sophie-f3cbba49979d417f4d3e2b830f7c58ac90aa55a1.tar.gz sophie-f3cbba49979d417f4d3e2b830f7c58ac90aa55a1.tar.zst sophie-f3cbba49979d417f4d3e2b830f7c58ac90aa55a1.zip |
test: More robust jest moduleNameMappers
Diffstat (limited to 'config')
-rw-r--r-- | config/jest.config.base.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/config/jest.config.base.js b/config/jest.config.base.js index bc34295..2ca021b 100644 --- a/config/jest.config.base.js +++ b/config/jest.config.base.js | |||
@@ -14,11 +14,11 @@ export default { | |||
14 | '.tsx', | 14 | '.tsx', |
15 | ], | 15 | ], |
16 | moduleNameMapper: { | 16 | moduleNameMapper: { |
17 | '@sophie/(.+)': join(thisDir, '../packages/$1/src/index.ts'), | 17 | '^@sophie/(.+)$': join(thisDir, '../packages/$1/src/index.ts'), |
18 | '^(\\.{1,2}/.*)\\.jsx?$': '$1', | 18 | '^(\\.{1,2}/.*)\\.jsx?$': '$1', |
19 | // Workaround for jest to recognize the vendored dependencies of chalk. | 19 | // Workaround for jest to recognize the vendored dependencies of chalk. |
20 | '#ansi-styles': join(thisDir, '../node_modules/chalk/source/vendor/ansi-styles/index.js'), | 20 | '^#ansi-styles$': join(thisDir, '../node_modules/chalk/source/vendor/ansi-styles/index.js'), |
21 | '#supports-color': join(thisDir, '../node_modules/chalk/source/vendor/supports-color/index.js'), | 21 | '^#supports-color$': join(thisDir, '../node_modules/chalk/source/vendor/supports-color/index.js'), |
22 | }, | 22 | }, |
23 | resetMocks: true, | 23 | resetMocks: true, |
24 | restoreMocks: true, | 24 | restoreMocks: true, |