mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
chore: Use isDevEnv() and isTestEnv() (#9264)
All checks were successful
Tests / test (push) Successful in 4m50s
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:
parent
77aca48c84
commit
e1bb59fb8f
16 changed files with 48 additions and 45 deletions
|
@ -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, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue