Skip to content

Commit

Permalink
fix(test): dont install AtomDevtools in test envs (#6480)
Browse files Browse the repository at this point in the history
**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
  • Loading branch information
liady authored Oct 7, 2024
1 parent 00b93bd commit 1e9d18a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/src/templates/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useAtomsDevtools } from 'jotai-devtools'
import '../utils/vite-hmr-config'
import {
getProjectID,
IS_TEST_ENVIRONMENT,
PROBABLY_ELECTRON,
PRODUCTION_ENV,
requireElectron,
Expand Down Expand Up @@ -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`)
}
Expand Down

0 comments on commit 1e9d18a

Please sign in to comment.