Skip to content

Commit f72da60

Browse files
committed
test(e2e): llm add typecheck
1 parent d74446b commit f72da60

File tree

10 files changed

+200
-151
lines changed

10 files changed

+200
-151
lines changed

apps/ledger-live-mobile/ios/Podfile.lock

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,15 +2441,15 @@ DEPENDENCIES:
24412441
- BVLinearGradient (from `../node_modules/react-native-linear-gradient`)
24422442
- "DatadogSDKReactNative (from `../node_modules/@datadog/mobile-react-native`)"
24432443
- "DoubleConversion (from `../../../node_modules/.pnpm/react-native@0.77.3_patch_hash=2b53c1e5f1809d0b579eb158f0090709b837442527d3897d1f563069_e5c117d3d754a7a98c260b18dfeac954/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)"
2444-
- "EXConstants (from `../../../node_modules/.pnpm/expo-constants@17.0.8_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5f1_68060181c6b197337d741123db6109b9/node_modules/expo-constants/ios`)"
2445-
- "EXImageLoader (from `../../../node_modules/.pnpm/expo-image-loader@5.0.0_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5_19a127edfcaf4cc45e7d65d3e0455c71/node_modules/expo-image-loader/ios`)"
2446-
- "Expo (from `../../../node_modules/.pnpm/expo@52.0.46_da95d96e6b14ca1108c91786bbc295f9/node_modules/expo`)"
2447-
- "ExpoAsset (from `../../../node_modules/.pnpm/expo-asset@11.0.5_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5f1809d_e12fbd8a50e595a6319b3e3621412cf0/node_modules/expo-asset/ios`)"
2448-
- "ExpoCrypto (from `../../../node_modules/.pnpm/expo-crypto@13.0.2_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5f1809_139024f99efa72035b7aa8ca5faa66eb/node_modules/expo-crypto/ios`)"
2449-
- "ExpoFileSystem (from `../../../node_modules/.pnpm/expo-file-system@18.0.1_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5_979371e6af3ae34c571344f67c59cd82/node_modules/expo-file-system/ios`)"
2450-
- "ExpoFont (from `../../../node_modules/.pnpm/expo-font@13.0.4_bddcfc85fa3d0a2d2bad040fdb52828d/node_modules/expo-font/ios`)"
2451-
- "ExpoImageManipulator (from `../../../node_modules/.pnpm/expo-image-manipulator@13.0.6_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b_47d96825de85513335ff56dea290b06d/node_modules/expo-image-manipulator/ios`)"
2452-
- "ExpoKeepAwake (from `../../../node_modules/.pnpm/expo-keep-awake@14.0.3_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5f_3650db67bc18acb2144583548348205c/node_modules/expo-keep-awake/ios`)"
2444+
- "EXConstants (from `../../../node_modules/.pnpm/expo-constants@17.0.8_176ddfde7199fc8230440531d34b5a22/node_modules/expo-constants/ios`)"
2445+
- "EXImageLoader (from `../../../node_modules/.pnpm/expo-image-loader@5.0.0_176ddfde7199fc8230440531d34b5a22/node_modules/expo-image-loader/ios`)"
2446+
- "Expo (from `../../../node_modules/.pnpm/expo@52.0.46_@babel+core@7.27.1_@babel+preset-env@7.27.1_@babel+core@7.27.1__expo-modul_53140f7fb2100cd288f142e41dfd26ed/node_modules/expo`)"
2447+
- "ExpoAsset (from `../../../node_modules/.pnpm/expo-asset@11.0.5_fe27d0449b241e4d57297a8cc76e548f/node_modules/expo-asset/ios`)"
2448+
- "ExpoCrypto (from `../../../node_modules/.pnpm/expo-crypto@13.0.2_176ddfde7199fc8230440531d34b5a22/node_modules/expo-crypto/ios`)"
2449+
- "ExpoFileSystem (from `../../../node_modules/.pnpm/expo-file-system@18.0.1_176ddfde7199fc8230440531d34b5a22/node_modules/expo-file-system/ios`)"
2450+
- "ExpoFont (from `../../../node_modules/.pnpm/expo-font@13.0.4_fe27d0449b241e4d57297a8cc76e548f/node_modules/expo-font/ios`)"
2451+
- "ExpoImageManipulator (from `../../../node_modules/.pnpm/expo-image-manipulator@13.0.6_176ddfde7199fc8230440531d34b5a22/node_modules/expo-image-manipulator/ios`)"
2452+
- "ExpoKeepAwake (from `../../../node_modules/.pnpm/expo-keep-awake@14.0.3_176ddfde7199fc8230440531d34b5a22/node_modules/expo-keep-awake/ios`)"
24532453
- "ExpoModulesCore (from `../../../node_modules/.pnpm/expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5f1809d0b579eb158f0090709_66be2728568375034107a6ab68203d84/node_modules/expo-modules-core`)"
24542454
- "fast_float (from `../../../node_modules/.pnpm/react-native@0.77.3_patch_hash=2b53c1e5f1809d0b579eb158f0090709b837442527d3897d1f563069_e5c117d3d754a7a98c260b18dfeac954/node_modules/react-native/third-party-podspecs/fast_float.podspec`)"
24552455
- "FBLazyVector (from `../../../node_modules/.pnpm/react-native@0.77.3_patch_hash=2b53c1e5f1809d0b579eb158f0090709b837442527d3897d1f563069_e5c117d3d754a7a98c260b18dfeac954/node_modules/react-native/Libraries/FBLazyVector`)"
@@ -2613,23 +2613,23 @@ EXTERNAL SOURCES:
26132613
DoubleConversion:
26142614
:podspec: "../../../node_modules/.pnpm/react-native@0.77.3_patch_hash=2b53c1e5f1809d0b579eb158f0090709b837442527d3897d1f563069_e5c117d3d754a7a98c260b18dfeac954/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
26152615
EXConstants:
2616-
:path: "../../../node_modules/.pnpm/expo-constants@17.0.8_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5f1_68060181c6b197337d741123db6109b9/node_modules/expo-constants/ios"
2616+
:path: "../../../node_modules/.pnpm/expo-constants@17.0.8_176ddfde7199fc8230440531d34b5a22/node_modules/expo-constants/ios"
26172617
EXImageLoader:
2618-
:path: "../../../node_modules/.pnpm/expo-image-loader@5.0.0_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5_19a127edfcaf4cc45e7d65d3e0455c71/node_modules/expo-image-loader/ios"
2618+
:path: "../../../node_modules/.pnpm/expo-image-loader@5.0.0_176ddfde7199fc8230440531d34b5a22/node_modules/expo-image-loader/ios"
26192619
Expo:
2620-
:path: "../../../node_modules/.pnpm/expo@52.0.46_da95d96e6b14ca1108c91786bbc295f9/node_modules/expo"
2620+
:path: "../../../node_modules/.pnpm/expo@52.0.46_@babel+core@7.27.1_@babel+preset-env@7.27.1_@babel+core@7.27.1__expo-modul_53140f7fb2100cd288f142e41dfd26ed/node_modules/expo"
26212621
ExpoAsset:
2622-
:path: "../../../node_modules/.pnpm/expo-asset@11.0.5_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5f1809d_e12fbd8a50e595a6319b3e3621412cf0/node_modules/expo-asset/ios"
2622+
:path: "../../../node_modules/.pnpm/expo-asset@11.0.5_fe27d0449b241e4d57297a8cc76e548f/node_modules/expo-asset/ios"
26232623
ExpoCrypto:
2624-
:path: "../../../node_modules/.pnpm/expo-crypto@13.0.2_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5f1809_139024f99efa72035b7aa8ca5faa66eb/node_modules/expo-crypto/ios"
2624+
:path: "../../../node_modules/.pnpm/expo-crypto@13.0.2_176ddfde7199fc8230440531d34b5a22/node_modules/expo-crypto/ios"
26252625
ExpoFileSystem:
2626-
:path: "../../../node_modules/.pnpm/expo-file-system@18.0.1_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5_979371e6af3ae34c571344f67c59cd82/node_modules/expo-file-system/ios"
2626+
:path: "../../../node_modules/.pnpm/expo-file-system@18.0.1_176ddfde7199fc8230440531d34b5a22/node_modules/expo-file-system/ios"
26272627
ExpoFont:
2628-
:path: "../../../node_modules/.pnpm/expo-font@13.0.4_bddcfc85fa3d0a2d2bad040fdb52828d/node_modules/expo-font/ios"
2628+
:path: "../../../node_modules/.pnpm/expo-font@13.0.4_fe27d0449b241e4d57297a8cc76e548f/node_modules/expo-font/ios"
26292629
ExpoImageManipulator:
2630-
:path: "../../../node_modules/.pnpm/expo-image-manipulator@13.0.6_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b_47d96825de85513335ff56dea290b06d/node_modules/expo-image-manipulator/ios"
2630+
:path: "../../../node_modules/.pnpm/expo-image-manipulator@13.0.6_176ddfde7199fc8230440531d34b5a22/node_modules/expo-image-manipulator/ios"
26312631
ExpoKeepAwake:
2632-
:path: "../../../node_modules/.pnpm/expo-keep-awake@14.0.3_expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5f_3650db67bc18acb2144583548348205c/node_modules/expo-keep-awake/ios"
2632+
:path: "../../../node_modules/.pnpm/expo-keep-awake@14.0.3_176ddfde7199fc8230440531d34b5a22/node_modules/expo-keep-awake/ios"
26332633
ExpoModulesCore:
26342634
:path: "../../../node_modules/.pnpm/expo-modules-core@2.2.3_react-native@0.77.3_patch_hash=2b53c1e5f1809d0b579eb158f0090709_66be2728568375034107a6ab68203d84/node_modules/expo-modules-core"
26352635
fast_float:

apps/ledger-live-mobile/scripts/e2e-ci.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const test_ios = async () => {
5858
--take-screenshots failing \
5959
--forceExit \
6060
--headless \
61-
--retries 0 \
61+
--retries 2 \
6262
--cleanup \
6363
${filteredArgs}`;
6464
};
@@ -75,7 +75,7 @@ const test_android = async () => {
7575
--take-screenshots failing \\
7676
--forceExit \\
7777
--headless \\
78-
--retries 0 \\
78+
--retries 2 \\
7979
--cleanup \\
8080
${filteredArgs}`;
8181
};

e2e/mobile/.husky/install.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Skip Husky install in production and CI
2+
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
3+
process.exit(0)
4+
}
5+
const husky = (await import('husky')).default
6+
console.log(husky())

e2e/mobile/.husky/pre-push

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# .husky/pre-push
2+
3+
if git diff --name-only origin/main...HEAD | grep -q "^e2e/mobile"; then
4+
echo "Running Husky pre-push for e2e mobile"
5+
echo "You can skip this by setting HUSKY=0 env var or adding -n/--no-verify on git command"
6+
7+
pnpm e2e:mobile typecheck
8+
fi

e2e/mobile/bridge/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Server } from "ws";
1+
import WebSocket from "ws";
22
import path from "path";
33
import fs from "fs";
44
import net from "net";
@@ -55,7 +55,7 @@ function isFeatureId(
5555
}
5656

5757
export function init(port = 8099, onConnection?: () => void) {
58-
webSocket.wss = new Server({ port });
58+
webSocket.wss = new WebSocket.Server({ port });
5959
webSocket.messages = {};
6060
log(`Start listening on localhost:${port}`);
6161

e2e/mobile/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"lint": "eslint . --ext .ts,.tsx --cache",
77
"lint:fix": "pnpm lint --fix",
8+
"typecheck": "tsc --noEmit --project ./tsconfig.json",
89
"test:detox": "pnpm detox test",
910
"test:ios": "pnpm test:detox --configuration ios.sim.release",
1011
"test:android": "pnpm test:detox --configuration android.emu.release",
@@ -14,8 +15,10 @@
1415
"test:android:debug": "pnpm test:detox --configuration android.emu.debug",
1516
"build:ios:debug": "pnpm --filter live-mobile run e2e:build --configuration ios.sim.debug",
1617
"build:android:debug": "pnpm --filter live-mobile run e2e:build --configuration android.emu.debug",
18+
"clean:detox": "pnpm detox clean-framework-cache && pnpm detox clean",
1719
"allure:generate": "allure generate ./artifacts --clean -o ./artifacts/allure-report",
18-
"allure:open": "allure open ./artifacts/allure-report"
20+
"allure:open": "allure open ./artifacts/allure-report",
21+
"prepare": "cd ../.. && husky e2e/mobile/.husky"
1922
},
2023
"dependencies": {
2124
"@ledgerhq/logs": "workspace:^",
@@ -60,12 +63,13 @@
6063
"expect": "27.5.1",
6164
"express": "4.22.0",
6265
"glob": "^11.0.1",
66+
"husky": "9.1.7",
6367
"jest": "30.2.0",
6468
"jest-allure2-reporter": "2.2.8",
6569
"jest-docblock": "30.2.0",
6670
"jest-environment-node": "30.2.0",
67-
"jest-util": "30.2.0",
6871
"jest-metadata": "1.6.0",
72+
"jest-util": "30.2.0",
6973
"lodash": "4.17.21",
7074
"ts-jest": "29.4.5",
7175
"ts-node": "10.9.2",

e2e/mobile/specs/ledgerSync/ledgerSync.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function initializeLedgerKeyRingProtocol() {
3030
return CLI.ledgerKeyRingProtocol({
3131
initMemberCredentials: true,
3232
apiBaseUrl: ledgerKeyRingProtocolArgs.apiBaseUrl,
33-
}).then((output: { pubkey: string; privatekey: string }) => {
33+
}).then(output => {
3434
if (output && "pubkey" in output) {
3535
ledgerKeyRingProtocolArgs.pubKey = output.pubkey;
3636
ledgerKeyRingProtocolArgs.privateKey = output.privatekey;
@@ -65,7 +65,7 @@ async function initializeLedgerSync() {
6565
const output = CLI.ledgerKeyRingProtocol({
6666
getKeyRingTree: true,
6767
...ledgerKeyRingProtocolArgs,
68-
}).then((out: { rootId: string; walletSyncEncryptionKey: string; applicationPath: string }) => {
68+
}).then(out => {
6969
if (out && "rootId" in out) {
7070
ledgerSyncPushDataArgs.rootId = out.rootId;
7171
ledgerSyncPushDataArgs.walletSyncEncryptionKey = out.walletSyncEncryptionKey;

e2e/mobile/tsconfig.json

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,27 @@
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"experimentalDecorators": true,
5+
"moduleResolution": "bundler",
6+
"moduleDetection": "force",
7+
"module": "preserve",
8+
"isolatedModules": true,
9+
"allowJs": false,
510
"checkJs": false,
611
"jsx": "react-native",
7-
"lib": [
8-
"es2017",
9-
"DOM"
10-
],
12+
"lib": ["es2017", "DOM"],
1113
"skipLibCheck": true,
1214
"noEmit": true,
1315
"baseUrl": ".",
14-
"typeRoots": [
15-
"./types",
16-
"./node_modules/@types"
17-
],
16+
"typeRoots": ["./types", "./node_modules/@types"],
1817
"paths": {
19-
"LLM/*": [
20-
"../../apps/ledger-live-mobile/src/newArch/*"
21-
],
22-
"~/*": [
23-
"../../apps/ledger-live-mobile/src/*"
24-
],
25-
"@ledgerhq/live-common/hw/index": [
26-
"../../libs/ledger-live-common/src/hw/index"
27-
],
28-
"@ledgerhq/live-common/hw/deviceAccess": [
29-
"../../libs/ledger-live-common/src/hw/deviceAccess"
30-
]
18+
"LLM/*": ["../../apps/ledger-live-mobile/src/newArch/*"],
19+
"~/*": ["../../apps/ledger-live-mobile/src/*"]
3120
}
3221
},
3322
"include": [
34-
"types",
35-
"**/*.ts",
36-
"**/*.tsx"
23+
"./**/*.ts",
24+
"../../apps/ledger-live-mobile/**/*.d.ts",
25+
"../../apps/ledger-live-mobile/src/**/*.{ts,tsx}"
3726
],
38-
"exclude": [
39-
"node_modules",
40-
"babel.config.js",
41-
"jest.config.js",
42-
"**/*.js"
43-
]
27+
"exclude": ["node_modules", "babel.config.js", "jest.config.js"]
4428
}

e2e/mobile/utils/initUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
removeSpeculosAndDeregisterKnownSpeculos,
1212
} from "./speculosUtils";
1313
import { waitForSpeculosReady } from "@ledgerhq/live-common/e2e/speculosCI";
14-
import { SettingsSetOverriddenFeatureFlagsPlayload } from "~/actions/types";
14+
import { SettingsSetOverriddenFeatureFlagsPlayload } from "../../../apps/ledger-live-mobile/src/actions/types";
1515

1616
type CliCommand = (
1717
userdataPath?: string,

0 commit comments

Comments
 (0)