From 28b60adbbe6111f85b4307df6347784d3d133684 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 19 Oct 2024 11:26:27 +0200 Subject: [PATCH] cli: fix react-dom/client check in Jest config Signed-off-by: Patrik Oldsberg --- .changeset/chilled-taxis-dance.md | 5 +++++ packages/cli/config/jest.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/chilled-taxis-dance.md diff --git a/.changeset/chilled-taxis-dance.md b/.changeset/chilled-taxis-dance.md new file mode 100644 index 0000000000..e2a5dcecee --- /dev/null +++ b/.changeset/chilled-taxis-dance.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +The check for `react-dom/client` in the Jest configuration will now properly always run from the target directory. diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 36ffd359aa..b979db5177 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -28,7 +28,9 @@ const envOptions = { }; try { - require.resolve('react-dom/client'); + require.resolve('react-dom/client', { + paths: [paths.targetRoot], + }); process.env.HAS_REACT_DOM_CLIENT = true; } catch { /* ignored */