@react-native-harness/cli 1.0.0-alpha.17 → 1.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../src/errors/errorHandler.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,MAuM5C,CAAC"}
1
+ {"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../src/errors/errorHandler.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,MAqK5C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { ConfigLoadError, ConfigNotFoundError, ConfigValidationError, } from '@react-native-harness/config';
2
2
  import { AssertionError } from '../utils.js';
3
- import { NoRunnerSpecifiedError, RunnerNotFoundError, EnvironmentInitializationError, TestExecutionError, RpcClientError, AppNotInstalledError, BridgeTimeoutError, BundlingFailedError, MetroPortUnavailableError, } from './errors.js';
3
+ import { NoRunnerSpecifiedError, RunnerNotFoundError, EnvironmentInitializationError, TestExecutionError, RpcClientError, BridgeTimeoutError, BundlingFailedError, MetroPortUnavailableError, } from './errors.js';
4
4
  export const formatError = (error) => {
5
5
  const lines = [];
6
6
  if (error instanceof AssertionError) {
@@ -103,30 +103,6 @@ export const formatError = (error) => {
103
103
  lines.push(` • Try restarting the app and test harness`);
104
104
  lines.push(`\nPlease check your bridge connection and try again.`);
105
105
  }
106
- else if (error instanceof AppNotInstalledError) {
107
- lines.push(`\n❌ App Not Installed`);
108
- const deviceType = error.platform === 'ios'
109
- ? 'simulator'
110
- : error.platform === 'android'
111
- ? 'emulator'
112
- : 'virtual device';
113
- lines.push(`\nThe app "${error.bundleId}" is not installed on ${deviceType} "${error.deviceName}".`);
114
- lines.push(`\nTo resolve this issue:`);
115
- if (error.platform === 'ios') {
116
- lines.push(` • Build and install the app: npx react-native run-ios --simulator="${error.deviceName}"`);
117
- lines.push(` • Or install from Xcode: Open ios/*.xcworkspace and run the project`);
118
- }
119
- else if (error.platform === 'android') {
120
- lines.push(` • Build and install the app: npx react-native run-android`);
121
- lines.push(` • Or build manually: ./gradlew assembleDebug && adb install android/app/build/outputs/apk/debug/app-debug.apk`);
122
- }
123
- else if (error.platform === 'vega') {
124
- lines.push(` • Build the Vega app: npm run build:app`);
125
- lines.push(` • Install the app: kepler device install-app -p <path-to-vpkg> --device "${error.deviceName}"`);
126
- lines.push(` • Or use the combined command: kepler run-kepler <path-to-vpkg> "${error.bundleId}" -d "${error.deviceName}"`);
127
- }
128
- lines.push(`\nPlease install the app and try running the tests again.`);
129
- }
130
106
  else if (error instanceof BundlingFailedError) {
131
107
  lines.push(`\n❌ Test File Bundling Error`);
132
108
  lines.push(`\nFile: ${error.modulePath}`);
@@ -1,4 +1,4 @@
1
- import { TestRunnerConfig } from '@react-native-harness/config';
1
+ type TestRunnerConfig = any;
2
2
  export declare class NoRunnerSpecifiedError extends Error {
3
3
  constructor(availableRunners: TestRunnerConfig[]);
4
4
  availableRunners: TestRunnerConfig[];
@@ -32,12 +32,6 @@ export declare class BridgeTimeoutError extends Error {
32
32
  readonly platform: string;
33
33
  constructor(timeout: number, runnerName: string, platform: string);
34
34
  }
35
- export declare class AppNotInstalledError extends Error {
36
- readonly deviceName: string;
37
- readonly bundleId: string;
38
- readonly platform: 'ios' | 'android' | 'vega';
39
- constructor(deviceName: string, bundleId: string, platform: 'ios' | 'android' | 'vega');
40
- }
41
35
  export declare class BundlingFailedError extends Error {
42
36
  readonly modulePath: string;
43
37
  readonly reason: string;
@@ -47,4 +41,5 @@ export declare class MetroPortUnavailableError extends Error {
47
41
  readonly port: number;
48
42
  constructor(port: number);
49
43
  }
44
+ export {};
50
45
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors/errors.ts"],"names":[],"mappings":"AAAA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,EACd,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM;IAenB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM;IAS3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,kBAAmB,SAAQ,KAAK;aAEzB,OAAO,EAAE,MAAM;aACf,UAAU,EAAE,MAAM;aAClB,QAAQ,EAAE,MAAM;gBAFhB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM;CAOnC;AAED,qBAAa,mBAAoB,SAAQ,KAAK;aAE1B,UAAU,EAAE,MAAM;aAClB,MAAM,EAAE,MAAM;gBADd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM;CAKjC;AAED,qBAAa,yBAA0B,SAAQ,KAAK;aACtB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAIzC"}
@@ -69,23 +69,6 @@ export class BridgeTimeoutError extends Error {
69
69
  this.name = 'BridgeTimeoutError';
70
70
  }
71
71
  }
72
- export class AppNotInstalledError extends Error {
73
- deviceName;
74
- bundleId;
75
- platform;
76
- constructor(deviceName, bundleId, platform) {
77
- const deviceType = platform === 'ios'
78
- ? 'simulator'
79
- : platform === 'android'
80
- ? 'emulator'
81
- : 'virtual device';
82
- super(`App "${bundleId}" is not installed on ${deviceType} "${deviceName}"`);
83
- this.deviceName = deviceName;
84
- this.bundleId = bundleId;
85
- this.platform = platform;
86
- this.name = 'AppNotInstalledError';
87
- }
88
- }
89
72
  export class BundlingFailedError extends Error {
90
73
  modulePath;
91
74
  reason;
@@ -1,11 +1,2 @@
1
- import { TestRunnerConfig } from '@react-native-harness/config';
2
- import { Environment } from './platforms/platform-adapter.js';
3
- import { BridgeServer } from '@react-native-harness/bridge/server';
4
- export type Harness = {
5
- environment: Environment;
6
- bridge: BridgeServer;
7
- };
8
- export declare const getHarness: (runner: TestRunnerConfig) => Promise<Harness>;
9
- export { formatError } from './errors/errorHandler.js';
10
- export * from './errors/errors.js';
1
+ export {};
11
2
  //# sourceMappingURL=external.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../src/external.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EACL,YAAY,EAEb,MAAM,qCAAqC,CAAC;AAI7C,MAAM,MAAM,OAAO,GAAG;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,QAAQ,gBAAgB,KACvB,OAAO,CAAC,OAAO,CA2BjB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../src/external.ts"],"names":[],"mappings":""}
package/dist/external.js CHANGED
@@ -1,27 +1 @@
1
- import { getBridgeServer, } from '@react-native-harness/bridge/server';
2
- import { BridgeTimeoutError } from './errors/errors.js';
3
- import { getPlatformAdapter } from './platforms/platform-registry.js';
4
- export const getHarness = async (runner) => {
5
- const bridgeTimeout = 60000;
6
- const platformAdapter = await getPlatformAdapter(runner.platform);
7
- const serverBridge = await getBridgeServer({
8
- port: 3001,
9
- });
10
- const readyPromise = new Promise((resolve, reject) => {
11
- const timeout = setTimeout(() => {
12
- reject(new BridgeTimeoutError(bridgeTimeout, runner.name, runner.platform));
13
- }, bridgeTimeout);
14
- serverBridge.once('ready', () => {
15
- clearTimeout(timeout);
16
- resolve();
17
- });
18
- });
19
- const environment = await platformAdapter.getEnvironment(runner);
20
- await readyPromise;
21
- return {
22
- environment,
23
- bridge: serverBridge,
24
- };
25
- };
26
- export { formatError } from './errors/errorHandler.js';
27
- export * from './errors/errors.js';
1
+ export {};