From 1e9d18a4723480d47493d3f9d5511d27c9b48c92 Mon Sep 17 00:00:00 2001 From: Liad Yosef Date: Mon, 7 Oct 2024 13:36:38 +0300 Subject: [PATCH] fix(test): dont install AtomDevtools in test envs (#6480) **Problem:** Today we get a lot of long warnings in the test logs about AtomDevtools. **Fix:** Don't install AtomDevtools in test environments, since they are only relevant for browser debugging. **Manual Tests:** I hereby swear that: - [X] I opened a hydrogen project and it loaded - [X] I could navigate to various routes in Play mode --- editor/src/templates/editor.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/src/templates/editor.tsx b/editor/src/templates/editor.tsx index d65daff780fb..c31c2a933d5d 100644 --- a/editor/src/templates/editor.tsx +++ b/editor/src/templates/editor.tsx @@ -10,6 +10,7 @@ import { useAtomsDevtools } from 'jotai-devtools' import '../utils/vite-hmr-config' import { getProjectID, + IS_TEST_ENVIRONMENT, PROBABLY_ELECTRON, PRODUCTION_ENV, requireElectron, @@ -709,7 +710,7 @@ export class Editor { let canvasUpdateId: number = 0 const AtomsDevtools = (props: { children: React.ReactNode }) => { - if (!PRODUCTION_ENV) { + if (!PRODUCTION_ENV && !IS_TEST_ENVIRONMENT) { // eslint-disable-next-line react-hooks/rules-of-hooks useAtomsDevtools(`Utopia Jotai Atoms Debug Store`) }