Skip to content

Commit

Permalink
do not proxy the console messages in tests (#4472)
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsbajorics authored Jan 11, 2024
1 parent d53c864 commit 6623745
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions editor/src/components/canvas/ui-jsx-canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import { useRefEditorState } from '../editor/store/store-hook'
import { matchRoutes } from 'react-router'
import { useAtom } from 'jotai'
import { RemixNavigationAtom } from './remix/utopia-remix-root-component'
import { IS_TEST_ENVIRONMENT } from '../../common/env-vars'

applyUIDMonkeyPatch()

Expand Down Expand Up @@ -336,9 +337,11 @@ export const UiJsxCanvas = React.memo<UiJsxCanvasPropsWithErrorCallback>((props)
}, 0)
})

// FIXME This is illegal! The two lines below are triggering a re-render
clearConsoleLogs()
proxyConsole(console, addToConsoleLogs)
if (!IS_TEST_ENVIRONMENT) {
// FIXME This is illegal! The two lines below are triggering a re-render
clearConsoleLogs()
proxyConsole(console, addToConsoleLogs)
}

React.useEffect(() => {
if (clearErrors != null) {
Expand Down

0 comments on commit 6623745

Please sign in to comment.