@rnx-kit/cli 0.14.9 → 0.14.10
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/CHANGELOG.md +10 -0
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/src/bundle/defaultPlugins.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/index.html +1 -1
- package/coverage/lcov-report/src/bundle/kit-config.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/metro.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/overrides.ts.html +1 -1
- package/coverage/lcov-report/src/copy-assets.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/metro-config.ts.html +1 -1
- package/coverage/lcov-report/src/typescript/index.html +1 -1
- package/coverage/lcov-report/src/typescript/project-cache.ts.html +1 -1
- package/lib/test.d.ts.map +1 -1
- package/lib/test.js +44 -11
- package/lib/test.js.map +1 -1
- package/package.json +6 -3
- package/src/test.ts +22 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Change Log - @rnx-kit/cli
|
|
2
2
|
|
|
3
|
+
## 0.14.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 80f823df: Fail gracefully if `jest-cli` is not installed (part 2)
|
|
8
|
+
- Updated dependencies [c14e998e]
|
|
9
|
+
- Updated dependencies [a5810bb8]
|
|
10
|
+
- @rnx-kit/dep-check@1.13.5
|
|
11
|
+
- @rnx-kit/tools-language@1.4.1
|
|
12
|
+
|
|
3
13
|
## 0.14.9
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/coverage/clover.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1667911662577" clover="3.2.0">
|
|
3
|
+
<project timestamp="1667911662577" name="All files">
|
|
4
4
|
<metrics statements="283" coveredstatements="139" conditionals="168" coveredconditionals="81" methods="44" coveredmethods="23" elements="495" coveredelements="243" complexity="0" loc="283" ncloc="283" packages="3" files="7" classes="7"/>
|
|
5
5
|
<package name="src">
|
|
6
6
|
<metrics statements="207" coveredstatements="108" conditionals="129" coveredconditionals="60" methods="27" coveredmethods="15"/>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
132
|
Code coverage generated by
|
|
133
133
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at Tue Nov
|
|
134
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
135
135
|
</div>
|
|
136
136
|
<script src="prettify.js"></script>
|
|
137
137
|
<script>
|
|
@@ -100,7 +100,7 @@ export function getDefaultBundlerPlugins(): Required<BundlerPlugins> {
|
|
|
100
100
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
101
101
|
Code coverage generated by
|
|
102
102
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
103
|
-
at Tue Nov
|
|
103
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
104
104
|
</div>
|
|
105
105
|
<script src="../../prettify.js"></script>
|
|
106
106
|
<script>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
147
147
|
Code coverage generated by
|
|
148
148
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
149
|
-
at Tue Nov
|
|
149
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
150
150
|
</div>
|
|
151
151
|
<script src="../../prettify.js"></script>
|
|
152
152
|
<script>
|
|
@@ -313,7 +313,7 @@ export function getCliPlatformBundleConfigs(
|
|
|
313
313
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
314
314
|
Code coverage generated by
|
|
315
315
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
316
|
-
at Tue Nov
|
|
316
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
317
317
|
</div>
|
|
318
318
|
<script src="../../prettify.js"></script>
|
|
319
319
|
<script>
|
|
@@ -211,7 +211,7 @@ export async function metroBundle(
|
|
|
211
211
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
212
212
|
Code coverage generated by
|
|
213
213
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
214
|
-
at Tue Nov
|
|
214
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
215
215
|
</div>
|
|
216
216
|
<script src="../../prettify.js"></script>
|
|
217
217
|
<script>
|
|
@@ -220,7 +220,7 @@ export function applyBundleConfigOverrides(
|
|
|
220
220
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
221
221
|
Code coverage generated by
|
|
222
222
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
223
|
-
at Tue Nov
|
|
223
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
224
224
|
</div>
|
|
225
225
|
<script src="../../prettify.js"></script>
|
|
226
226
|
<script>
|
|
@@ -1762,7 +1762,7 @@ export const rnxCopyAssetsCommand = {
|
|
|
1762
1762
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1763
1763
|
Code coverage generated by
|
|
1764
1764
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1765
|
-
at Tue Nov
|
|
1765
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
1766
1766
|
</div>
|
|
1767
1767
|
<script src="../prettify.js"></script>
|
|
1768
1768
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at Tue Nov
|
|
119
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -586,7 +586,7 @@ export function customizeMetroConfig(
|
|
|
586
586
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
587
587
|
Code coverage generated by
|
|
588
588
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
589
|
-
at Tue Nov
|
|
589
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
590
590
|
</div>
|
|
591
591
|
<script src="../prettify.js"></script>
|
|
592
592
|
<script>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at Tue Nov
|
|
104
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -697,7 +697,7 @@ export function createProjectCache(
|
|
|
697
697
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
698
698
|
Code coverage generated by
|
|
699
699
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
700
|
-
at Tue Nov
|
|
700
|
+
at Tue Nov 08 2022 12:47:42 GMT+0000 (Coordinated Universal Time)
|
|
701
701
|
</div>
|
|
702
702
|
<script src="../../prettify.js"></script>
|
|
703
703
|
<script>
|
package/lib/test.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAM7E,aAAK,IAAI,GAAG;IACV,QAAQ,EAAE,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;CAC7D,CAAC;AAEF,aAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACjC,OAAO,CAAC,EACJ,MAAM,GACN,OAAO,GACP,MAAM,GACN,CAAC,CAAC,MAAM,EAAE,SAAS,KAAK,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;CACxD,CAAC;AASF,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,SAAS,EAClB,EAAE,QAAQ,EAAE,EAAE,IAAI,GACjB,IAAI,CA8BN;AA4BD,eAAO,MAAM,cAAc;;;;;CAY1B,CAAC"}
|
package/lib/test.js
CHANGED
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.rnxTestCommand = exports.rnxTest = void 0;
|
|
4
27
|
const console_1 = require("@rnx-kit/console");
|
|
5
28
|
const tools_node_1 = require("@rnx-kit/tools-node");
|
|
6
29
|
const platform_1 = require("@rnx-kit/tools-react-native/platform");
|
|
30
|
+
const path = __importStar(require("path"));
|
|
7
31
|
const COMMAND_NAME = "rnx-test";
|
|
32
|
+
function resolveJestCli() {
|
|
33
|
+
const jestPath = path.dirname(require.resolve("jest/package.json"));
|
|
34
|
+
return require.resolve("jest-cli", { paths: [jestPath] });
|
|
35
|
+
}
|
|
8
36
|
function rnxTest(_argv, _config, { platform }) {
|
|
9
37
|
const runJest = (() => {
|
|
10
38
|
try {
|
|
11
|
-
const { run } = require(
|
|
39
|
+
const { run } = require(resolveJestCli());
|
|
12
40
|
return run;
|
|
13
41
|
}
|
|
14
42
|
catch (e) {
|
|
@@ -41,16 +69,21 @@ function jestOptions() {
|
|
|
41
69
|
//
|
|
42
70
|
// To work around this, resolve `jest-cli` first, then use the resolved path
|
|
43
71
|
// to import `./build/cli/args`.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
72
|
+
try {
|
|
73
|
+
const jestPath = (0, tools_node_1.findPackageDependencyDir)(resolveJestCli()) || "jest-cli";
|
|
74
|
+
const { options } = require(`${jestPath}/build/cli/args`);
|
|
75
|
+
return Object.keys(options).map((option) => {
|
|
76
|
+
const { default: defaultValue, description, type } = options[option];
|
|
77
|
+
return {
|
|
78
|
+
name: `--${option} [${type}]`,
|
|
79
|
+
description,
|
|
80
|
+
default: defaultValue,
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
catch (_) {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
54
87
|
}
|
|
55
88
|
exports.rnxTestCommand = {
|
|
56
89
|
name: COMMAND_NAME,
|
package/lib/test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8CAAyC;AACzC,oDAA+D;AAC/D,mEAAqE;AACrE,2CAA6B;AAiB7B,MAAM,YAAY,GAAG,UAAU,CAAC;AAEhC,SAAS,cAAc;IACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACpE,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,SAAgB,OAAO,CACrB,KAAe,EACf,OAAkB,EAClB,EAAE,QAAQ,EAAQ;IAElB,MAAM,OAAO,GAA6B,CAAC,GAAG,EAAE;QAC9C,IAAI;YACF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;YAC1C,OAAO,GAAG,CAAC;SACZ;QAAC,OAAO,CAAC,EAAE;YACV,IAAA,eAAK,EAAC,+DAA+D,CAAC,CAAC;YACvE,MAAM,CAAC,CAAC;SACT;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACxD,IAAI,YAAY,GAAG,CAAC,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;KACtD;IAED,4EAA4E;IAC5E,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IAElD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACjD,IAAI,aAAa,GAAG,CAAC,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KACxD;IAED,yEAAyE;IACzE,qEAAqE;IACrE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;IAE9B,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,QAAQ,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAlCD,0BAkCC;AAED,SAAS,WAAW;IAClB,oDAAoD;IACpD,EAAE;IACF,oEAAoE;IACpE,wCAAwC;IACxC,EAAE;IACF,4EAA4E;IAC5E,gCAAgC;IAChC,IAAI;QACF,MAAM,QAAQ,GAAG,IAAA,qCAAwB,EAAC,cAAc,EAAE,CAAC,IAAI,UAAU,CAAC;QAE1E,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,QAAQ,iBAAiB,CAAC,CAAC;QAE1D,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACzC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;YACrE,OAAO;gBACL,IAAI,EAAE,KAAK,MAAM,KAAK,IAAI,GAAG;gBAC7B,WAAW;gBACX,OAAO,EAAE,YAAY;aACtB,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAEY,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,mCAAmC;IAChD,IAAI,EAAE,OAAO;IACb,OAAO,EAAE;QACP;YACE,IAAI,EAAE,8CAA8C;YACpD,WAAW,EAAE,oBAAoB;YACjC,KAAK,EAAE,wBAAa;SACrB;QACD,GAAG,WAAW,EAAE;KACjB;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnx-kit/cli",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.10",
|
|
4
4
|
"description": "Command-line interface for working with kit packages in your repo",
|
|
5
5
|
"homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/cli",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@rnx-kit/config": "^0.5.2",
|
|
23
23
|
"@rnx-kit/console": "^1.0.11",
|
|
24
|
-
"@rnx-kit/dep-check": "^1.13.
|
|
24
|
+
"@rnx-kit/dep-check": "^1.13.5",
|
|
25
25
|
"@rnx-kit/metro-plugin-cyclic-dependencies-detector": "^1.0.21",
|
|
26
26
|
"@rnx-kit/metro-plugin-duplicates-checker": "^2.0.0",
|
|
27
27
|
"@rnx-kit/metro-serializer": "^1.0.11",
|
|
28
28
|
"@rnx-kit/metro-serializer-esbuild": "^0.1.0",
|
|
29
29
|
"@rnx-kit/metro-service": "^3.0.2",
|
|
30
30
|
"@rnx-kit/third-party-notices": "^1.2.13",
|
|
31
|
-
"@rnx-kit/tools-language": "^1.4.
|
|
31
|
+
"@rnx-kit/tools-language": "^1.4.1",
|
|
32
32
|
"@rnx-kit/tools-node": "^1.2.7",
|
|
33
33
|
"@rnx-kit/tools-react-native": "^1.2.0",
|
|
34
34
|
"@rnx-kit/typescript-react-native-resolver": "^0.2.0",
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"@react-native-community/cli-server-api": {
|
|
49
49
|
"optional": true
|
|
50
|
+
},
|
|
51
|
+
"jest-cli": {
|
|
52
|
+
"optional": true
|
|
50
53
|
}
|
|
51
54
|
},
|
|
52
55
|
"devDependencies": {
|
package/src/test.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Config as CLIConfig } from "@react-native-community/cli-types";
|
|
|
2
2
|
import { error } from "@rnx-kit/console";
|
|
3
3
|
import { findPackageDependencyDir } from "@rnx-kit/tools-node";
|
|
4
4
|
import { parsePlatform } from "@rnx-kit/tools-react-native/platform";
|
|
5
|
+
import * as path from "path";
|
|
5
6
|
|
|
6
7
|
type Args = {
|
|
7
8
|
platform: "android" | "ios" | "macos" | "windows" | "win32";
|
|
@@ -20,6 +21,11 @@ type Options = {
|
|
|
20
21
|
|
|
21
22
|
const COMMAND_NAME = "rnx-test";
|
|
22
23
|
|
|
24
|
+
function resolveJestCli(): string {
|
|
25
|
+
const jestPath = path.dirname(require.resolve("jest/package.json"));
|
|
26
|
+
return require.resolve("jest-cli", { paths: [jestPath] });
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
export function rnxTest(
|
|
24
30
|
_argv: string[],
|
|
25
31
|
_config: CLIConfig,
|
|
@@ -27,7 +33,7 @@ export function rnxTest(
|
|
|
27
33
|
): void {
|
|
28
34
|
const runJest: (argv: string[]) => void = (() => {
|
|
29
35
|
try {
|
|
30
|
-
const { run } = require(
|
|
36
|
+
const { run } = require(resolveJestCli());
|
|
31
37
|
return run;
|
|
32
38
|
} catch (e) {
|
|
33
39
|
error("'rnx-test' is unavailable because 'jest-cli' is not installed");
|
|
@@ -64,17 +70,22 @@ function jestOptions(): Options[] {
|
|
|
64
70
|
//
|
|
65
71
|
// To work around this, resolve `jest-cli` first, then use the resolved path
|
|
66
72
|
// to import `./build/cli/args`.
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
try {
|
|
74
|
+
const jestPath = findPackageDependencyDir(resolveJestCli()) || "jest-cli";
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
const { options } = require(`${jestPath}/build/cli/args`);
|
|
77
|
+
|
|
78
|
+
return Object.keys(options).map((option) => {
|
|
79
|
+
const { default: defaultValue, description, type } = options[option];
|
|
80
|
+
return {
|
|
81
|
+
name: `--${option} [${type}]`,
|
|
82
|
+
description,
|
|
83
|
+
default: defaultValue,
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
} catch (_) {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
78
89
|
}
|
|
79
90
|
|
|
80
91
|
export const rnxTestCommand = {
|