From f3cbba49979d417f4d3e2b830f7c58ac90aa55a1 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Fri, 31 Dec 2021 17:34:57 +0100 Subject: test: More robust jest moduleNameMappers --- config/jest.config.base.js | 6 +++--- 1 file 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 { '.tsx', ], moduleNameMapper: { - '@sophie/(.+)': join(thisDir, '../packages/$1/src/index.ts'), + '^@sophie/(.+)$': join(thisDir, '../packages/$1/src/index.ts'), '^(\\.{1,2}/.*)\\.jsx?$': '$1', // Workaround for jest to recognize the vendored dependencies of chalk. - '#ansi-styles': join(thisDir, '../node_modules/chalk/source/vendor/ansi-styles/index.js'), - '#supports-color': join(thisDir, '../node_modules/chalk/source/vendor/supports-color/index.js'), + '^#ansi-styles$': join(thisDir, '../node_modules/chalk/source/vendor/ansi-styles/index.js'), + '^#supports-color$': join(thisDir, '../node_modules/chalk/source/vendor/supports-color/index.js'), }, resetMocks: true, restoreMocks: true, -- cgit v1.2.3-54-g00ecf