From f4bf0e15e276679253c8920d629f7b0a6b6a5b0f Mon Sep 17 00:00:00 2001 From: Dovid Levine Date: Fri, 13 Mar 2026 00:54:04 +0200 Subject: [PATCH] tests(jest): Fix __mocks__ location --- jest.config.js | 1 + {__mocks__ => tests/js/__mocks__}/@wordpress/api-fetch.ts | 0 tests/js/tsconfig.json | 4 ++-- 3 files changed, 3 insertions(+), 2 deletions(-) rename {__mocks__ => tests/js/__mocks__}/@wordpress/api-fetch.ts (100%) diff --git a/jest.config.js b/jest.config.js index 670eff3..fe3245a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -22,6 +22,7 @@ module.exports = { // Root directory for tests rootDir: '.', + roots: [ '', '/tests/js' ], // Test setup files run after Jest environment is set up setupFilesAfterEnv: [ diff --git a/__mocks__/@wordpress/api-fetch.ts b/tests/js/__mocks__/@wordpress/api-fetch.ts similarity index 100% rename from __mocks__/@wordpress/api-fetch.ts rename to tests/js/__mocks__/@wordpress/api-fetch.ts diff --git a/tests/js/tsconfig.json b/tests/js/tsconfig.json index 2f3e5a5..858cf6f 100644 --- a/tests/js/tsconfig.json +++ b/tests/js/tsconfig.json @@ -7,8 +7,8 @@ "types": [ "jest", "node", "@testing-library/jest-dom" ] }, "include": [ - "./*.ts", - "./*.tsx", + "./**/*.ts", + "./**/*.tsx", "../../assets/src/**/*.ts", "../../assets/src/**/*.tsx" ],