Skip to content

Commit f32b976

Browse files
test: removing the hard-coded fallback in the patch
1 parent bb76037 commit f32b976

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

e2e/mobile/jest.globalSetup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { isSpeculosRemote } from "./helpers/commonHelpers";
1717
import { SPECULOS_TRACKING_FILE } from "./utils/speculosUtils";
1818
import { NANO_APP_CATALOG_PATH } from "./utils/constants";
1919
import { sanitizeError } from "@ledgerhq/live-common/e2e/index";
20-
import { DetoxAllure2AdapterOptions } from "detox-allure2-adapter";
20+
import type { DetoxAllure2AdapterOptions } from "detox-allure2-adapter";
2121

2222
export default async function setup(): Promise<void> {
2323
const envFileName = process.env.ENV_FILE || ".env.mock";

patches/detox-allure2-adapter@1.0.0-alpha.42.patch

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
--- a/dist/listener.js
22
+++ b/dist/listener.js
3-
@@ -75,8 +75,21 @@
3+
@@ -75,8 +75,20 @@
44
onError,
55
});
66
}
77
- if (deviceVideos) {
88
- const baseOptions = deviceVideos === true ? {} : deviceVideos;
99
+ // PATCH: Check DETOX_ENABLE_VIDEO env var to enable video dynamically
10-
+ // DETOX_VIDEO_OPTIONS is JSON config string, e.g.: {"android":{"recording":{"bitRate":1000000}}}
1110
+ const enableVideoFromEnv = process.env.DETOX_ENABLE_VIDEO === 'true';
1211
+ const effectiveDeviceVideos = enableVideoFromEnv ? (deviceVideos || true) : deviceVideos;
1312
+ if (effectiveDeviceVideos) {
1413
+ let baseOptions = effectiveDeviceVideos === true ? {} : effectiveDeviceVideos;
15-
+ // If enabled via env var, check for JSON options or use defaults
16-
+ if (enableVideoFromEnv) {
14+
+ // If enabled via env var, optionally override options from DETOX_VIDEO_OPTIONS
15+
+ if (enableVideoFromEnv && process.env.DETOX_VIDEO_OPTIONS) {
1716
+ try {
18-
+ baseOptions = process.env.DETOX_VIDEO_OPTIONS ? JSON.parse(process.env.DETOX_VIDEO_OPTIONS) : {};
17+
+ baseOptions = JSON.parse(process.env.DETOX_VIDEO_OPTIONS);
1918
+ } catch (e) {
20-
+ console.warn('Failed to parse DETOX_VIDEO_OPTIONS:', e instanceof Error ? e.message : String(e));
19+
+ console.warn('Failed to parse DETOX_VIDEO_OPTIONS; falling back to default video options.', e);
2120
+ baseOptions = {};
2221
+ }
2322
+ }
2423
videoManager = new video_1.VideoManager({ device, options: baseOptions, onError });
2524
}
2625
if (deviceViewHierarchy && viewHierarchyFactory) {
27-
@@ -152,7 +165,7 @@
26+
@@ -152,7 +164,7 @@
2827
})
2928
.on('test_fn_failure', async () => {
3029
failing = true;

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)