Skip to content

Commit 2307cd3

Browse files
committed
test(jet): check device before attempting to use it
this method is called after cleanup during lifecycle finish of tests, with an empty device. cleanup was not called prior so this bug wasn't evident
1 parent 94f5ba6 commit 2307cd3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/patches/jet+0.6.6-0.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/node_modules/jet/lib/node/patch/detox.js b/node_modules/jet/lib/node/patch/detox.js
2+
index fdca559..9092118 100644
3+
--- a/node_modules/jet/lib/node/patch/detox.js
4+
+++ b/node_modules/jet/lib/node/patch/detox.js
5+
@@ -28,6 +28,9 @@ if (detox) {
6+
// device.reloadReactNative({ ... })
7+
// todo detoxOriginalReloadReactNative currently broken it seems
8+
// const detoxOriginalReloadReactNative = originalDevice.reloadReactNative.bind(originalDevice);
9+
+ if (!originalDevice) {
10+
+ return undefined;
11+
+ }
12+
originalDevice.reloadReactNative = async () => {
13+
ready.reset();
14+
global.jet.reload();

0 commit comments

Comments
 (0)