Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Disable upgrade notice on Jest environment
  • Loading branch information
fluiddot committed Mar 1, 2022
commit 58f64aa182af16bf7e6564fc35cef3f0e04810ad
3 changes: 2 additions & 1 deletion src/handlers/createHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
findNodeHandle,
} from './gestureHandlerCommon';
import { ValueOf } from '../typeUtils';
import { isJestEnv } from '../utils';

const UIManagerAny = UIManager as any;

Expand Down Expand Up @@ -172,7 +173,7 @@ export default function createHandler<
}
handlerIDToTag[props.id] = this.handlerTag;
}
if (__DEV__) {
if (__DEV__ && !isJestEnv()) {
showRngh2NoticeIfNeeded();
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ export function toArray<T>(object: T | T[]): T[] {

return object;
}

export function isJestEnv(): boolean {
return !!process.env.JEST_WORKER_ID;
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"esModuleInterop": true,
"jsx": "react-native",
"lib": ["esnext"],
"types": [],
"types": ["node"],
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
Expand Down