@react-native-harness/config 1.0.0-alpha.1

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.
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Callstack
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # config
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build config` to build the library.
@@ -0,0 +1,5 @@
1
+ import { Config, NativeTestRunnerConfig } from './types.js';
2
+ export declare function assertNativeRunner(config: Config): asserts config is Config & {
3
+ runner: NativeTestRunnerConfig;
4
+ };
5
+ //# sourceMappingURL=assertions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAE5D,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,IAAI,MAAM,GAAG;IAAE,MAAM,EAAE,sBAAsB,CAAA;CAAE,CAO/D"}
@@ -0,0 +1,6 @@
1
+ export function assertNativeRunner(config) {
2
+ if (config.runner.platform !== 'ios' &&
3
+ config.runner.platform !== 'android') {
4
+ throw new Error('Runner is not a native runner');
5
+ }
6
+ }
@@ -0,0 +1,15 @@
1
+ export declare class ConfigValidationError extends Error {
2
+ readonly filePath: string;
3
+ readonly validationErrors: string[];
4
+ constructor(filePath: string, validationErrors: string[]);
5
+ }
6
+ export declare class ConfigNotFoundError extends Error {
7
+ readonly searchPath: string;
8
+ constructor(searchPath: string);
9
+ }
10
+ export declare class ConfigLoadError extends Error {
11
+ readonly filePath: string;
12
+ readonly cause?: Error;
13
+ constructor(filePath: string, cause?: Error);
14
+ }
15
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAsB,SAAQ,KAAK;aAExB,QAAQ,EAAE,MAAM;aAChB,gBAAgB,EAAE,MAAM,EAAE;gBAD1B,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EAAE;CAKjD;AAED,qBAAa,mBAAoB,SAAQ,KAAK;aACd,UAAU,EAAE,MAAM;gBAAlB,UAAU,EAAE,MAAM;CAIjD;AAED,qBAAa,eAAgB,SAAQ,KAAK;aAGV,QAAQ,EAAE,MAAM;IAF5C,SAAyB,KAAK,CAAC,EAAE,KAAK,CAAC;gBAEX,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAK9D"}
package/dist/errors.js ADDED
@@ -0,0 +1,28 @@
1
+ export class ConfigValidationError extends Error {
2
+ filePath;
3
+ validationErrors;
4
+ constructor(filePath, validationErrors) {
5
+ super(`Invalid configuration in ${filePath}`);
6
+ this.filePath = filePath;
7
+ this.validationErrors = validationErrors;
8
+ this.name = 'ConfigValidationError';
9
+ }
10
+ }
11
+ export class ConfigNotFoundError extends Error {
12
+ searchPath;
13
+ constructor(searchPath) {
14
+ super(`Config file not found in ${searchPath} or any parent directories`);
15
+ this.searchPath = searchPath;
16
+ this.name = 'ConfigNotFoundError';
17
+ }
18
+ }
19
+ export class ConfigLoadError extends Error {
20
+ filePath;
21
+ cause;
22
+ constructor(filePath, cause) {
23
+ super(`Failed to load config file ${filePath}`);
24
+ this.filePath = filePath;
25
+ this.name = 'ConfigLoadError';
26
+ this.cause = cause;
27
+ }
28
+ }
@@ -0,0 +1,5 @@
1
+ export { getConfig } from './reader.js';
2
+ export type { Config, TestRunnerConfig, Platform, Reporter, BrowserType, NativeTestRunnerConfig, WebTestRunnerConfig } from './types.js';
3
+ export { ConfigValidationError, ConfigNotFoundError, ConfigLoadError } from './errors.js';
4
+ export { isNativeRunnerConfig, isWebRunnerConfig, assertNativeRunnerConfig, assertWebRunnerConfig } from './types.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EACR,MAAM,EACN,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,sBAAsB,EACtB,mBAAmB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACH,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACH,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACxB,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { getConfig } from './reader.js';
2
+ export { ConfigValidationError, ConfigNotFoundError, ConfigLoadError } from './errors.js';
3
+ export { isNativeRunnerConfig, isWebRunnerConfig, assertNativeRunnerConfig, assertWebRunnerConfig } from './types.js';
@@ -0,0 +1,3 @@
1
+ import { Config } from './types.js';
2
+ export declare const getConfig: (dir: string) => Promise<Config>;
3
+ //# sourceMappingURL=reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../src/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,YAAY,CAAC;AAkElD,eAAO,MAAM,SAAS,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,CAM3D,CAAC"}
package/dist/reader.js ADDED
@@ -0,0 +1,54 @@
1
+ import { ConfigSchema } from './types.js';
2
+ import { ConfigValidationError, ConfigNotFoundError, ConfigLoadError } from './errors.js';
3
+ import path from 'node:path';
4
+ import fs from 'node:fs';
5
+ import { createRequire } from 'node:module';
6
+ import { ZodError } from 'zod';
7
+ const extensions = ['.js', '.mjs', '.cjs', '.json'];
8
+ const importUp = async (dir, name) => {
9
+ const filePath = path.join(dir, name);
10
+ for (const ext of extensions) {
11
+ const filePathWithExt = `${filePath}${ext}`;
12
+ if (fs.existsSync(filePathWithExt)) {
13
+ let rawConfig;
14
+ try {
15
+ if (ext === '.mjs') {
16
+ rawConfig = await import(filePathWithExt).then((module) => module.default);
17
+ }
18
+ else {
19
+ const require = createRequire(import.meta.url);
20
+ rawConfig = require(filePathWithExt);
21
+ }
22
+ }
23
+ catch (error) {
24
+ throw new ConfigLoadError(filePathWithExt, error instanceof Error ? error : undefined);
25
+ }
26
+ try {
27
+ const config = ConfigSchema.parse(rawConfig);
28
+ return { config, filePathWithExt, configDir: dir };
29
+ }
30
+ catch (error) {
31
+ if (error instanceof ZodError) {
32
+ const validationErrors = error.errors.map(err => {
33
+ const path = err.path.length > 0 ? ` at "${err.path.join('.')}"` : '';
34
+ return `${err.message}${path}`;
35
+ });
36
+ throw new ConfigValidationError(filePathWithExt, validationErrors);
37
+ }
38
+ throw error;
39
+ }
40
+ }
41
+ }
42
+ const parentDir = path.dirname(dir);
43
+ if (parentDir === dir) {
44
+ throw new ConfigNotFoundError(dir);
45
+ }
46
+ return importUp(parentDir, name);
47
+ };
48
+ export const getConfig = async (dir) => {
49
+ const { config } = await importUp(dir, 'rn-harness.config');
50
+ return {
51
+ ...config,
52
+ reporter: config.reporter,
53
+ };
54
+ };
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/tslib/tslib.d.ts","../../../node_modules/tslib/modules/index.d.ts","../src/errors.ts","../../../node_modules/zod/dist/types/v3/helpers/typealiases.d.ts","../../../node_modules/zod/dist/types/v3/helpers/util.d.ts","../../../node_modules/zod/dist/types/v3/zoderror.d.ts","../../../node_modules/zod/dist/types/v3/locales/en.d.ts","../../../node_modules/zod/dist/types/v3/errors.d.ts","../../../node_modules/zod/dist/types/v3/helpers/parseutil.d.ts","../../../node_modules/zod/dist/types/v3/helpers/enumutil.d.ts","../../../node_modules/zod/dist/types/v3/helpers/errorutil.d.ts","../../../node_modules/zod/dist/types/v3/helpers/partialutil.d.ts","../../../node_modules/zod/dist/types/v3/standard-schema.d.ts","../../../node_modules/zod/dist/types/v3/types.d.ts","../../../node_modules/zod/dist/types/v3/external.d.ts","../../../node_modules/zod/dist/types/v3/index.d.ts","../../../node_modules/zod/dist/types/index.d.ts","../src/types.ts","../src/reader.ts","../src/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts"],"fileIdsList":[[79,125],[82,125],[83,88,116,125],[84,95,96,103,113,124,125],[84,85,95,103,125],[86,125],[87,88,96,104,125],[88,113,121,125],[89,91,95,103,125],[90,125],[91,92,125],[95,125],[93,95,125],[95,96,97,113,124,125],[95,96,97,110,113,116,125],[125,129],[125],[91,95,98,103,113,124,125],[95,96,98,99,103,113,121,124,125],[98,100,113,121,124,125],[79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131],[95,101,125],[102,124,125],[91,95,103,113,125],[104,125],[105,125],[82,106,125],[107,123,125,129],[108,125],[109,125],[95,110,111,125],[110,112,125,127],[83,95,113,114,115,116,125],[83,113,115,125],[113,114,125],[116,125],[117,125],[95,119,120,125],[119,120,125],[88,103,113,121,125],[122,125],[103,123,125],[83,98,109,124,125],[88,125],[113,125,126],[125,127],[125,128],[83,88,95,97,106,113,124,125,127,129],[113,125,130],[59,125],[74,125],[64,65,125],[62,63,64,66,67,72,125],[63,64,125],[72,125],[73,125],[64,125],[62,63,64,67,68,69,70,71,125],[62,63,74,125],[60,125],[60,61,76,77,125],[60,61,75,76,96,102,105,125],[60,75,125]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6a5253138c5432c68a1510c70fe78a644fe2e632111ba778e1978010d6edfec","impliedFormat":1},{"version":"b8f34dd1757f68e03262b1ca3ddfa668a855b872f8bdd5224d6f993a7b37dc2c","impliedFormat":99},{"version":"e9aadca2fd66e7ef6e39f1ae41aae2b7f7cb34f37b7430005dbe08b4ae3ac2d8","signature":"ab21498cc9c3434e5d72dede3ec195c94b992f2c37b2e8458e06503ae428d626","impliedFormat":99},{"version":"d3cfde44f8089768ebb08098c96d01ca260b88bccf238d55eee93f1c620ff5a5","impliedFormat":1},{"version":"293eadad9dead44c6fd1db6de552663c33f215c55a1bfa2802a1bceed88ff0ec","impliedFormat":1},{"version":"54f6ec6ea75acea6eb23635617252d249145edbc7bcd9d53f2d70280d2aef953","impliedFormat":1},{"version":"c25ce98cca43a3bfa885862044be0d59557be4ecd06989b2001a83dcf69620fd","impliedFormat":1},{"version":"8e71e53b02c152a38af6aec45e288cc65bede077b92b9b43b3cb54a37978bb33","impliedFormat":1},{"version":"754a9396b14ca3a4241591afb4edc644b293ccc8a3397f49be4dfd520c08acb3","impliedFormat":1},{"version":"f672c876c1a04a223cf2023b3d91e8a52bb1544c576b81bf64a8fec82be9969c","impliedFormat":1},{"version":"e4b03ddcf8563b1c0aee782a185286ed85a255ce8a30df8453aade2188bbc904","impliedFormat":1},{"version":"de2316e90fc6d379d83002f04ad9698bc1e5285b4d52779778f454dd12ce9f44","impliedFormat":1},{"version":"25b3f581e12ede11e5739f57a86e8668fbc0124f6649506def306cad2c59d262","impliedFormat":1},{"version":"2da997a01a6aa5c5c09de5d28f0f4407b597c5e1aecfd32f1815809c532650a2","impliedFormat":1},{"version":"5d26d2e47e2352def36f89a3e8bf8581da22b7f857e07ef3114cd52cf4813445","impliedFormat":1},{"version":"3db2efd285e7328d8014b54a7fce3f4861ebcdc655df40517092ed0050983617","impliedFormat":1},{"version":"d5d39a24c759df40480a4bfc0daffd364489702fdbcbdfc1711cde34f8739995","impliedFormat":1},{"version":"e0932f314331bc425052318843d24a015a13a6ca45b0f8f85fd537319405f797","signature":"7b1626355a7fc135e6abf7d07c5a0d3e3d8ee2d48c073eb7b00f4d8ceca47d87","impliedFormat":99},{"version":"cecc9443882ea058b0f5d200cb03bb1eef290fbe4ab6698fb197184a5b0a6f72","signature":"32ae4dd91e565f7e81d22807dcfe460b766d52d7e47141ff0a12a9d3ade09616","impliedFormat":99},{"version":"6ff1044e92d899dd53e3aa6b5b69f163e95fd6bdd01648fba109dc7c9e0f7c79","signature":"bac31d869789d8dcf7c14dd0d0fae67acea2437fdaf23e4a120eb4bcd5c7d88a","impliedFormat":99},{"version":"7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","impliedFormat":1},{"version":"a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a","impliedFormat":1},{"version":"f749812878fecfa53cfc13b36e5d35086fb6377983a9df44175da83ccc23af1f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7d2e3fea24c712c99c03ad8f556abedbfe105f87f1be10b95dbd409d24bc05a3","impliedFormat":1},{"version":"211e3f15fbced4ab4be19f49ffa990b9ff20d749d33b65ff753be691e7616239","affectsGlobalScope":true,"impliedFormat":1},{"version":"3719525a8f6ab731e3dfd585d9f87df55ec7d50d461df84f74eb4d68bb165244","impliedFormat":1},{"version":"5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713","impliedFormat":1},{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true,"impliedFormat":1},{"version":"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","impliedFormat":1},{"version":"e596c9bb2f29a2699fdd4ae89139612652245192f67f45617c5a4b20832aaae9","impliedFormat":1},{"version":"bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","impliedFormat":1},{"version":"1cdcfc1f624d6c08aa12c73935f6e13f095919cd99edf95752951796eb225729","impliedFormat":1},{"version":"4eaff3d8e10676fd7913d8c108890e71c688e1e7d52f6d1d55c39514f493dc47","impliedFormat":1},{"version":"14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","impliedFormat":1},{"version":"5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea","impliedFormat":1},{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true,"impliedFormat":1},{"version":"00dee7cdca8b8420c47ea4a31a34b8e8294013ebc4f463fd941e867e7bf05029","affectsGlobalScope":true,"impliedFormat":1},{"version":"3256f3cccd578f9e7fe3a28096c505634bebcee8afb738ffa99368e536ca3a0b","impliedFormat":1},{"version":"1c84b46267610a34028edfd0d035509341751262bac1062857f3c8df7aff7153","impliedFormat":1},{"version":"7f138842074d0a40681775af008c8452093b68c383c94de31759e853c6d06b5c","impliedFormat":1},{"version":"a3d541d303ee505053f5dcbf9fafb65cac3d5631037501cd616195863a6c5740","impliedFormat":1},{"version":"8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","impliedFormat":1},{"version":"2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58","impliedFormat":1},{"version":"e630e5528e899219ae319e83bef54bf3bcb91b01d76861ecf881e8e614b167f0","affectsGlobalScope":true,"impliedFormat":1},{"version":"bcebb922784739bdb34c18ee51095d25a92b560c78ccd2eaacd6bd00f7443d83","impliedFormat":1},{"version":"7ee6ed878c4528215c82b664fe0cfe80e8b4da6c0d4cc80869367868774db8b1","impliedFormat":1},{"version":"b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30","impliedFormat":1},{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0715e4cd28ad471b2a93f3e552ff51a3ae423417a01a10aa1d3bc7c6b95059d6","affectsGlobalScope":true,"impliedFormat":1},{"version":"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","impliedFormat":1},{"version":"210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","impliedFormat":1},{"version":"36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","impliedFormat":1},{"version":"0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","impliedFormat":1},{"version":"25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","impliedFormat":1},{"version":"4f3fdeba4e28e21aa719c081b8dc8f91d47e12e773389b9d35679c08151c9d37","impliedFormat":1},{"version":"1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","impliedFormat":1},{"version":"69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","impliedFormat":1},{"version":"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","impliedFormat":1},{"version":"23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","impliedFormat":1},{"version":"f69ff39996a61a0dd10f4bce73272b52e8024a4d58b13ab32bf4712909d0a2b7","impliedFormat":1},{"version":"3c4ba1dd9b12ffa284b565063108f2f031d150ea15b8fafbdc17f5d2a07251f3","affectsGlobalScope":true,"impliedFormat":1},{"version":"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","impliedFormat":1},{"version":"1422cd9e705adcc09088fda85a900c2b70e3ad36ea85846f68bd1a884cdf4e2b","impliedFormat":1},{"version":"3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","impliedFormat":1},{"version":"5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2","impliedFormat":1},{"version":"a73ae8c0e62103bb9e21bb6538700881bf135b9a8b125b857ec68edfa0da4ed3","affectsGlobalScope":true,"impliedFormat":1},{"version":"e1c1b2fbe236bf7ee3e342eeae7e20efb8988a0ac7da1cbbfa2c1f66b76c3423","affectsGlobalScope":true,"impliedFormat":1},{"version":"868831cab82b65dfe1d68180e898af1f2101e89ba9b754d1db6fb8cc2fac1921","impliedFormat":1},{"version":"0fe8985a28f82c450a04a6edf1279d7181c0893f37da7d2a27f8efd4fd5edb03","impliedFormat":1},{"version":"e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa","impliedFormat":1},{"version":"52120bb7e4583612225bdf08e7c12559548170f11e660d33a33623bae9bbdbba","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6dd3dba8e665ac43d279e0fdf5219edda0eed69b5e9a5061f46cd6a65c4f7a1","impliedFormat":1}],"root":[61,[76,78]],"options":{"composite":true,"declarationMap":true,"emitDeclarationOnly":false,"importHelpers":true,"module":199,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUnusedLocals":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"target":9,"tsBuildInfoFile":"./tsconfig.lib.tsbuildinfo"},"referencedMap":[[79,1],[80,1],[82,2],[83,3],[84,4],[85,5],[86,6],[87,7],[88,8],[89,9],[90,10],[91,11],[92,11],[94,12],[93,13],[95,12],[96,14],[97,15],[81,16],[131,17],[98,18],[99,19],[100,20],[132,21],[101,22],[102,23],[103,24],[104,25],[105,26],[106,27],[107,28],[108,29],[109,30],[110,31],[111,31],[112,32],[113,33],[115,34],[114,35],[116,36],[117,37],[118,17],[119,38],[120,39],[121,40],[122,41],[123,42],[124,43],[125,44],[126,45],[127,46],[128,47],[129,48],[130,49],[60,50],[59,17],[57,17],[58,17],[11,17],[10,17],[2,17],[12,17],[13,17],[14,17],[15,17],[16,17],[17,17],[18,17],[19,17],[3,17],[20,17],[21,17],[4,17],[22,17],[26,17],[23,17],[24,17],[25,17],[27,17],[28,17],[29,17],[5,17],[30,17],[31,17],[32,17],[33,17],[6,17],[37,17],[34,17],[35,17],[36,17],[38,17],[7,17],[39,17],[44,17],[45,17],[40,17],[41,17],[42,17],[43,17],[8,17],[49,17],[46,17],[47,17],[48,17],[50,17],[9,17],[51,17],[52,17],[53,17],[55,17],[54,17],[1,17],[56,17],[75,51],[66,52],[73,53],[68,17],[69,17],[67,54],[70,55],[62,17],[63,17],[74,56],[65,57],[71,17],[72,58],[64,59],[61,60],[78,61],[77,62],[76,63]],"latestChangedDtsFile":"./types.d.ts","version":"5.8.3"}
@@ -0,0 +1,187 @@
1
+ import { z } from 'zod';
2
+ export declare const PlatformSchema: z.ZodEnum<["ios", "android", "web"]>;
3
+ export declare const ReporterSchema: z.ZodObject<{
4
+ report: z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodAny, "many">], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ report: (args_0: any[], ...args: unknown[]) => Promise<void>;
7
+ }, {
8
+ report: (args_0: any[], ...args: unknown[]) => Promise<void>;
9
+ }>;
10
+ export declare const BrowserTypeSchema: z.ZodEnum<["chrome", "firefox", "safari"]>;
11
+ export declare const NativeTestRunnerConfigSchema: z.ZodObject<{
12
+ name: z.ZodString;
13
+ platform: z.ZodEnum<["ios", "android"]>;
14
+ deviceId: z.ZodString;
15
+ bundleId: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ name: string;
18
+ platform: "ios" | "android";
19
+ deviceId: string;
20
+ bundleId: string;
21
+ }, {
22
+ name: string;
23
+ platform: "ios" | "android";
24
+ deviceId: string;
25
+ bundleId: string;
26
+ }>;
27
+ export declare const WebTestRunnerConfigSchema: z.ZodObject<{
28
+ name: z.ZodString;
29
+ platform: z.ZodLiteral<"web">;
30
+ browser: z.ZodEnum<["chrome", "firefox", "safari"]>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ name: string;
33
+ platform: "web";
34
+ browser: "chrome" | "firefox" | "safari";
35
+ }, {
36
+ name: string;
37
+ platform: "web";
38
+ browser: "chrome" | "firefox" | "safari";
39
+ }>;
40
+ export declare const TestRunnerConfigSchema: z.ZodDiscriminatedUnion<"platform", [z.ZodObject<{
41
+ name: z.ZodString;
42
+ platform: z.ZodEnum<["ios", "android"]>;
43
+ deviceId: z.ZodString;
44
+ bundleId: z.ZodString;
45
+ }, "strip", z.ZodTypeAny, {
46
+ name: string;
47
+ platform: "ios" | "android";
48
+ deviceId: string;
49
+ bundleId: string;
50
+ }, {
51
+ name: string;
52
+ platform: "ios" | "android";
53
+ deviceId: string;
54
+ bundleId: string;
55
+ }>, z.ZodObject<{
56
+ name: z.ZodString;
57
+ platform: z.ZodLiteral<"web">;
58
+ browser: z.ZodEnum<["chrome", "firefox", "safari"]>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ name: string;
61
+ platform: "web";
62
+ browser: "chrome" | "firefox" | "safari";
63
+ }, {
64
+ name: string;
65
+ platform: "web";
66
+ browser: "chrome" | "firefox" | "safari";
67
+ }>]>;
68
+ export declare const ConfigSchema: z.ZodEffects<z.ZodObject<{
69
+ include: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, string | string[], string | string[]>;
70
+ runners: z.ZodArray<z.ZodDiscriminatedUnion<"platform", [z.ZodObject<{
71
+ name: z.ZodString;
72
+ platform: z.ZodEnum<["ios", "android"]>;
73
+ deviceId: z.ZodString;
74
+ bundleId: z.ZodString;
75
+ }, "strip", z.ZodTypeAny, {
76
+ name: string;
77
+ platform: "ios" | "android";
78
+ deviceId: string;
79
+ bundleId: string;
80
+ }, {
81
+ name: string;
82
+ platform: "ios" | "android";
83
+ deviceId: string;
84
+ bundleId: string;
85
+ }>, z.ZodObject<{
86
+ name: z.ZodString;
87
+ platform: z.ZodLiteral<"web">;
88
+ browser: z.ZodEnum<["chrome", "firefox", "safari"]>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ name: string;
91
+ platform: "web";
92
+ browser: "chrome" | "firefox" | "safari";
93
+ }, {
94
+ name: string;
95
+ platform: "web";
96
+ browser: "chrome" | "firefox" | "safari";
97
+ }>]>, "many">;
98
+ defaultRunner: z.ZodOptional<z.ZodString>;
99
+ reporter: z.ZodOptional<z.ZodObject<{
100
+ report: z.ZodFunction<z.ZodTuple<[z.ZodArray<z.ZodAny, "many">], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ report: (args_0: any[], ...args: unknown[]) => Promise<void>;
103
+ }, {
104
+ report: (args_0: any[], ...args: unknown[]) => Promise<void>;
105
+ }>>;
106
+ bridgeTimeout: z.ZodDefault<z.ZodNumber>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ include: string | string[];
109
+ runners: ({
110
+ name: string;
111
+ platform: "ios" | "android";
112
+ deviceId: string;
113
+ bundleId: string;
114
+ } | {
115
+ name: string;
116
+ platform: "web";
117
+ browser: "chrome" | "firefox" | "safari";
118
+ })[];
119
+ bridgeTimeout: number;
120
+ defaultRunner?: string | undefined;
121
+ reporter?: {
122
+ report: (args_0: any[], ...args: unknown[]) => Promise<void>;
123
+ } | undefined;
124
+ }, {
125
+ include: string | string[];
126
+ runners: ({
127
+ name: string;
128
+ platform: "ios" | "android";
129
+ deviceId: string;
130
+ bundleId: string;
131
+ } | {
132
+ name: string;
133
+ platform: "web";
134
+ browser: "chrome" | "firefox" | "safari";
135
+ })[];
136
+ defaultRunner?: string | undefined;
137
+ reporter?: {
138
+ report: (args_0: any[], ...args: unknown[]) => Promise<void>;
139
+ } | undefined;
140
+ bridgeTimeout?: number | undefined;
141
+ }>, {
142
+ include: string | string[];
143
+ runners: ({
144
+ name: string;
145
+ platform: "ios" | "android";
146
+ deviceId: string;
147
+ bundleId: string;
148
+ } | {
149
+ name: string;
150
+ platform: "web";
151
+ browser: "chrome" | "firefox" | "safari";
152
+ })[];
153
+ bridgeTimeout: number;
154
+ defaultRunner?: string | undefined;
155
+ reporter?: {
156
+ report: (args_0: any[], ...args: unknown[]) => Promise<void>;
157
+ } | undefined;
158
+ }, {
159
+ include: string | string[];
160
+ runners: ({
161
+ name: string;
162
+ platform: "ios" | "android";
163
+ deviceId: string;
164
+ bundleId: string;
165
+ } | {
166
+ name: string;
167
+ platform: "web";
168
+ browser: "chrome" | "firefox" | "safari";
169
+ })[];
170
+ defaultRunner?: string | undefined;
171
+ reporter?: {
172
+ report: (args_0: any[], ...args: unknown[]) => Promise<void>;
173
+ } | undefined;
174
+ bridgeTimeout?: number | undefined;
175
+ }>;
176
+ export type Platform = z.infer<typeof PlatformSchema>;
177
+ export type Reporter = z.infer<typeof ReporterSchema>;
178
+ export type BrowserType = z.infer<typeof BrowserTypeSchema>;
179
+ export type NativeTestRunnerConfig = z.infer<typeof NativeTestRunnerConfigSchema>;
180
+ export type WebTestRunnerConfig = z.infer<typeof WebTestRunnerConfigSchema>;
181
+ export type TestRunnerConfig = z.infer<typeof TestRunnerConfigSchema>;
182
+ export type Config = z.infer<typeof ConfigSchema>;
183
+ export declare function isNativeRunnerConfig(config: TestRunnerConfig): config is NativeTestRunnerConfig;
184
+ export declare function isWebRunnerConfig(config: TestRunnerConfig): config is WebTestRunnerConfig;
185
+ export declare function assertNativeRunnerConfig(config: TestRunnerConfig): asserts config is NativeTestRunnerConfig;
186
+ export declare function assertWebRunnerConfig(config: TestRunnerConfig): asserts config is WebTestRunnerConfig;
187
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,sCAAoC,CAAC;AAEhE,eAAO,MAAM,cAAc;;;;;;EAEzB,CAAC;AAEH,eAAO,MAAM,iBAAiB,4CAA0C,CAAC;AAEzE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;EAKvC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAIpC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGjC,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCtB,CAAC;AAEJ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,gBAAgB,GACvB,MAAM,IAAI,sBAAsB,CAElC;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,gBAAgB,GACvB,MAAM,IAAI,mBAAmB,CAE/B;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,MAAM,IAAI,sBAAsB,CAM1C;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,MAAM,IAAI,mBAAmB,CAMvC"}
package/dist/types.js ADDED
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod';
2
+ export const PlatformSchema = z.enum(['ios', 'android', 'web']);
3
+ export const ReporterSchema = z.object({
4
+ report: z.function().args(z.array(z.any())).returns(z.promise(z.void())),
5
+ });
6
+ export const BrowserTypeSchema = z.enum(['chrome', 'firefox', 'safari']);
7
+ export const NativeTestRunnerConfigSchema = z.object({
8
+ name: z.string().min(1, 'Runner name is required'),
9
+ platform: z.enum(['ios', 'android']),
10
+ deviceId: z.string().min(1, 'Device ID is required'),
11
+ bundleId: z.string().min(1, 'Bundle ID is required'),
12
+ });
13
+ export const WebTestRunnerConfigSchema = z.object({
14
+ name: z.string().min(1, 'Runner name is required'),
15
+ platform: z.literal('web'),
16
+ browser: BrowserTypeSchema,
17
+ });
18
+ export const TestRunnerConfigSchema = z.discriminatedUnion('platform', [
19
+ NativeTestRunnerConfigSchema,
20
+ WebTestRunnerConfigSchema,
21
+ ]);
22
+ export const ConfigSchema = z
23
+ .object({
24
+ include: z.union([z.string(), z.array(z.string())]).refine((val) => {
25
+ if (Array.isArray(val)) {
26
+ return val.length > 0;
27
+ }
28
+ return val.length > 0;
29
+ }, { message: 'Include patterns cannot be empty' }),
30
+ runners: z
31
+ .array(TestRunnerConfigSchema)
32
+ .min(1, 'At least one runner is required'),
33
+ defaultRunner: z.string().optional(),
34
+ reporter: ReporterSchema.optional(),
35
+ bridgeTimeout: z
36
+ .number()
37
+ .min(1000, 'Bridge timeout must be at least 1 second')
38
+ .default(60000),
39
+ })
40
+ .refine((config) => {
41
+ if (config.defaultRunner) {
42
+ return config.runners.some((runner) => runner.name === config.defaultRunner);
43
+ }
44
+ return true;
45
+ }, {
46
+ message: 'Default runner must match one of the configured runner names',
47
+ path: ['defaultRunner'],
48
+ });
49
+ export function isNativeRunnerConfig(config) {
50
+ return config.platform === 'ios' || config.platform === 'android';
51
+ }
52
+ export function isWebRunnerConfig(config) {
53
+ return config.platform === 'web';
54
+ }
55
+ export function assertNativeRunnerConfig(config) {
56
+ if (!isNativeRunnerConfig(config)) {
57
+ throw new Error(`Expected native runner config but got platform: ${config.platform}`);
58
+ }
59
+ }
60
+ export function assertWebRunnerConfig(config) {
61
+ if (!isWebRunnerConfig(config)) {
62
+ throw new Error(`Expected web runner config but got platform: ${config.platform}`);
63
+ }
64
+ }
@@ -0,0 +1,19 @@
1
+ import baseConfig from '../../eslint.config.mjs';
2
+
3
+ export default [
4
+ ...baseConfig,
5
+ {
6
+ files: ['**/*.json'],
7
+ rules: {
8
+ '@nx/dependency-checks': [
9
+ 'error',
10
+ {
11
+ ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}'],
12
+ },
13
+ ],
14
+ },
15
+ languageOptions: {
16
+ parser: await import('jsonc-eslint-parser'),
17
+ },
18
+ },
19
+ ];
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@react-native-harness/config",
3
+ "version": "1.0.0-alpha.1",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": {
11
+ "development": "./src/index.ts",
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "default": "./dist/index.js"
15
+ }
16
+ },
17
+ "dependencies": {
18
+ "tslib": "^2.3.0",
19
+ "zod": "^3.25.67"
20
+ }
21
+ }
package/src/errors.ts ADDED
@@ -0,0 +1,26 @@
1
+ export class ConfigValidationError extends Error {
2
+ constructor(
3
+ public readonly filePath: string,
4
+ public readonly validationErrors: string[]
5
+ ) {
6
+ super(`Invalid configuration in ${filePath}`);
7
+ this.name = 'ConfigValidationError';
8
+ }
9
+ }
10
+
11
+ export class ConfigNotFoundError extends Error {
12
+ constructor(public readonly searchPath: string) {
13
+ super(`Config file not found in ${searchPath} or any parent directories`);
14
+ this.name = 'ConfigNotFoundError';
15
+ }
16
+ }
17
+
18
+ export class ConfigLoadError extends Error {
19
+ public override readonly cause?: Error;
20
+
21
+ constructor(public readonly filePath: string, cause?: Error) {
22
+ super(`Failed to load config file ${filePath}`);
23
+ this.name = 'ConfigLoadError';
24
+ this.cause = cause;
25
+ }
26
+ }
package/src/index.ts ADDED
@@ -0,0 +1,21 @@
1
+ export { getConfig } from './reader.js';
2
+ export type {
3
+ Config,
4
+ TestRunnerConfig,
5
+ Platform,
6
+ Reporter,
7
+ BrowserType,
8
+ NativeTestRunnerConfig,
9
+ WebTestRunnerConfig
10
+ } from './types.js';
11
+ export {
12
+ ConfigValidationError,
13
+ ConfigNotFoundError,
14
+ ConfigLoadError
15
+ } from './errors.js';
16
+ export {
17
+ isNativeRunnerConfig,
18
+ isWebRunnerConfig,
19
+ assertNativeRunnerConfig,
20
+ assertWebRunnerConfig
21
+ } from './types.js';
package/src/reader.ts ADDED
@@ -0,0 +1,73 @@
1
+ import { Config, ConfigSchema } from './types.js';
2
+ import { ConfigValidationError, ConfigNotFoundError, ConfigLoadError } from './errors.js';
3
+ import path from 'node:path';
4
+ import fs from 'node:fs';
5
+ import { createRequire } from 'node:module';
6
+ import { ZodError } from 'zod';
7
+
8
+ const extensions = ['.js', '.mjs', '.cjs', '.json'];
9
+
10
+ const importUp = async (
11
+ dir: string,
12
+ name: string
13
+ ): Promise<{
14
+ config: Config;
15
+ filePathWithExt: string;
16
+ configDir: string;
17
+ }> => {
18
+ const filePath = path.join(dir, name);
19
+
20
+ for (const ext of extensions) {
21
+ const filePathWithExt = `${filePath}${ext}`;
22
+ if (fs.existsSync(filePathWithExt)) {
23
+ let rawConfig: unknown;
24
+
25
+ try {
26
+ if (ext === '.mjs') {
27
+ rawConfig = await import(filePathWithExt).then((module) => module.default);
28
+ } else {
29
+ const require = createRequire(import.meta.url);
30
+ rawConfig = require(filePathWithExt);
31
+ }
32
+ } catch (error) {
33
+ throw new ConfigLoadError(
34
+ filePathWithExt,
35
+ error instanceof Error ? error : undefined
36
+ );
37
+ }
38
+
39
+ try {
40
+ const config = ConfigSchema.parse(rawConfig);
41
+ return { config, filePathWithExt, configDir: dir };
42
+ } catch (error) {
43
+ if (error instanceof ZodError) {
44
+ const validationErrors = error.errors.map(err => {
45
+ const path = err.path.length > 0 ? ` at "${err.path.join('.')}"` : '';
46
+ return `${err.message}${path}`;
47
+ });
48
+
49
+ throw new ConfigValidationError(
50
+ filePathWithExt,
51
+ validationErrors
52
+ );
53
+ }
54
+ throw error;
55
+ }
56
+ }
57
+ }
58
+
59
+ const parentDir = path.dirname(dir);
60
+ if (parentDir === dir) {
61
+ throw new ConfigNotFoundError(dir);
62
+ }
63
+
64
+ return importUp(parentDir, name);
65
+ };
66
+
67
+ export const getConfig = async (dir: string): Promise<Config> => {
68
+ const { config } = await importUp(dir, 'rn-harness.config');
69
+ return {
70
+ ...config,
71
+ reporter: config.reporter,
72
+ };
73
+ };
package/src/types.ts ADDED
@@ -0,0 +1,105 @@
1
+ import { z } from 'zod';
2
+
3
+ export const PlatformSchema = z.enum(['ios', 'android', 'web']);
4
+
5
+ export const ReporterSchema = z.object({
6
+ report: z.function().args(z.array(z.any())).returns(z.promise(z.void())),
7
+ });
8
+
9
+ export const BrowserTypeSchema = z.enum(['chrome', 'firefox', 'safari']);
10
+
11
+ export const NativeTestRunnerConfigSchema = z.object({
12
+ name: z.string().min(1, 'Runner name is required'),
13
+ platform: z.enum(['ios', 'android']),
14
+ deviceId: z.string().min(1, 'Device ID is required'),
15
+ bundleId: z.string().min(1, 'Bundle ID is required'),
16
+ });
17
+
18
+ export const WebTestRunnerConfigSchema = z.object({
19
+ name: z.string().min(1, 'Runner name is required'),
20
+ platform: z.literal('web'),
21
+ browser: BrowserTypeSchema,
22
+ });
23
+
24
+ export const TestRunnerConfigSchema = z.discriminatedUnion('platform', [
25
+ NativeTestRunnerConfigSchema,
26
+ WebTestRunnerConfigSchema,
27
+ ]);
28
+
29
+ export const ConfigSchema = z
30
+ .object({
31
+ include: z.union([z.string(), z.array(z.string())]).refine(
32
+ (val) => {
33
+ if (Array.isArray(val)) {
34
+ return val.length > 0;
35
+ }
36
+ return val.length > 0;
37
+ },
38
+ { message: 'Include patterns cannot be empty' }
39
+ ),
40
+ runners: z
41
+ .array(TestRunnerConfigSchema)
42
+ .min(1, 'At least one runner is required'),
43
+ defaultRunner: z.string().optional(),
44
+ reporter: ReporterSchema.optional(),
45
+ bridgeTimeout: z
46
+ .number()
47
+ .min(1000, 'Bridge timeout must be at least 1 second')
48
+ .default(60000),
49
+ })
50
+ .refine(
51
+ (config) => {
52
+ if (config.defaultRunner) {
53
+ return config.runners.some(
54
+ (runner) => runner.name === config.defaultRunner
55
+ );
56
+ }
57
+ return true;
58
+ },
59
+ {
60
+ message: 'Default runner must match one of the configured runner names',
61
+ path: ['defaultRunner'],
62
+ }
63
+ );
64
+
65
+ export type Platform = z.infer<typeof PlatformSchema>;
66
+ export type Reporter = z.infer<typeof ReporterSchema>;
67
+ export type BrowserType = z.infer<typeof BrowserTypeSchema>;
68
+ export type NativeTestRunnerConfig = z.infer<
69
+ typeof NativeTestRunnerConfigSchema
70
+ >;
71
+ export type WebTestRunnerConfig = z.infer<typeof WebTestRunnerConfigSchema>;
72
+ export type TestRunnerConfig = z.infer<typeof TestRunnerConfigSchema>;
73
+ export type Config = z.infer<typeof ConfigSchema>;
74
+
75
+ export function isNativeRunnerConfig(
76
+ config: TestRunnerConfig
77
+ ): config is NativeTestRunnerConfig {
78
+ return config.platform === 'ios' || config.platform === 'android';
79
+ }
80
+
81
+ export function isWebRunnerConfig(
82
+ config: TestRunnerConfig
83
+ ): config is WebTestRunnerConfig {
84
+ return config.platform === 'web';
85
+ }
86
+
87
+ export function assertNativeRunnerConfig(
88
+ config: TestRunnerConfig
89
+ ): asserts config is NativeTestRunnerConfig {
90
+ if (!isNativeRunnerConfig(config)) {
91
+ throw new Error(
92
+ `Expected native runner config but got platform: ${config.platform}`
93
+ );
94
+ }
95
+ }
96
+
97
+ export function assertWebRunnerConfig(
98
+ config: TestRunnerConfig
99
+ ): asserts config is WebTestRunnerConfig {
100
+ if (!isWebRunnerConfig(config)) {
101
+ throw new Error(
102
+ `Expected web runner config but got platform: ${config.platform}`
103
+ );
104
+ }
105
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "files": [],
4
+ "include": [],
5
+ "references": [
6
+ {
7
+ "path": "./tsconfig.lib.json"
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "rootDir": "src",
6
+ "outDir": "dist",
7
+ "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
8
+ "emitDeclarationOnly": false,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "types": ["node"]
11
+ },
12
+ "include": ["src/**/*.ts"],
13
+ "references": []
14
+ }