From 109f72b0505d5116bd37f5abfe72b9194ec716d3 Mon Sep 17 00:00:00 2001 From: Igor <35524806+igorschoester@users.noreply.github.com> Date: Sat, 27 Apr 2024 10:08:17 +0200 Subject: [PATCH] Clean Jest config * remove the UI library source from the module mapping, it is expected to run build before test instead * remove different node_module overrides * add WP i18n to the module mapping to ensure a singleton, this fixes the text-domain warnings --- packages/js/jest.config.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/js/jest.config.js b/packages/js/jest.config.js index 0f36cd9f072..58472ffd867 100644 --- a/packages/js/jest.config.js +++ b/packages/js/jest.config.js @@ -20,13 +20,11 @@ module.exports = { "find-with-regex": "/node_modules/find-with-regex/lib/index.js", "^lodash-es$": "lodash", "^lodash-es/(.*)$": "lodash/$1", - "@yoast/ui-library": "/../ui-library/src", + "@wordpress/i18n": [ + "node_modules/@wordpress/i18n", + "/../../node_modules/@wordpress/i18n", + ], }, - moduleDirectories: [ - "/node_modules", - "/../../node_modules", - "node_modules", - ], collectCoverageFrom: [ "src/**/*.{js,jsx,ts,tsx}", ],