chore: Use isDevEnv() and isTestEnv() (#9264)
All checks were successful
Tests / test (push) Successful in 4m50s

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mursaleen Nisar 2025-03-25 00:14:00 +05:30 committed by GitHub
parent 77aca48c84
commit e1bb59fb8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 48 additions and 45 deletions

View file

@ -85,7 +85,6 @@ import {
DRAGGING_THRESHOLD,
ELEMENT_SHIFT_TRANSLATE_AMOUNT,
ELEMENT_TRANSLATE_AMOUNT,
ENV,
EVENT,
FRAME_STYLE,
IMAGE_MIME_TYPES,
@ -258,6 +257,7 @@ import {
getDateTime,
isShallowEqual,
arrayToMap,
isDevEnv,
} from "../utils";
import {
createSrcDoc,
@ -2434,7 +2434,7 @@ class App extends React.Component<AppProps, AppState> {
this.excalidrawContainerValue.container =
this.excalidrawContainerRef.current;
if (import.meta.env.MODE === ENV.TEST || import.meta.env.DEV) {
if (isTestEnv() || isDevEnv()) {
const setState = this.setState.bind(this);
Object.defineProperties(window.h, {
state: {
@ -11060,7 +11060,7 @@ declare global {
}
export const createTestHook = () => {
if (import.meta.env.MODE === ENV.TEST || import.meta.env.DEV) {
if (isTestEnv() || isDevEnv()) {
window.h = window.h || ({} as Window["h"]);
Object.defineProperties(window.h, {