Skip to content

Commit 27e7dae

Browse files
committed
Add stdout and stderr to status assert
1 parent 46934c5 commit 27e7dae

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/host/src/node/gradle.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const TEST_APP_ANDROID_PATH = path.join(MONOREPO_ROOT, "apps/test-app/android");
1010
describe("Gradle tasks", () => {
1111
describe("checkHermesOverride task", () => {
1212
it("should fail if REACT_NATIVE_OVERRIDE_HERMES_DIR is not set", () => {
13-
const { status, stderr } = cp.spawnSync(
13+
const { status, stdout, stderr } = cp.spawnSync(
1414
"sh",
1515
["gradlew", "react-native-node-api:checkHermesOverride"],
1616
{
@@ -23,7 +23,7 @@ describe("Gradle tasks", () => {
2323
},
2424
);
2525

26-
assert.notDeepEqual(status, 0);
26+
assert.notDeepEqual(status, 0, `Expected failure: ${stdout} ${stderr}`);
2727
assert.match(
2828
stderr,
2929
/React Native Node-API needs a custom version of Hermes with Node-API enabled/,
@@ -45,7 +45,7 @@ describe("Gradle tasks", () => {
4545

4646
describe("linkNodeApiModules task", () => {
4747
it("should call the CLI to autolink", () => {
48-
const { status, stdout } = cp.spawnSync(
48+
const { status, stdout, stderr } = cp.spawnSync(
4949
"sh",
5050
["gradlew", "react-native-node-api:linkNodeApiModules"],
5151
{
@@ -54,7 +54,11 @@ describe("Gradle tasks", () => {
5454
},
5555
);
5656

57-
assert.equal(status, 0);
57+
assert.equal(
58+
status,
59+
0,
60+
`Expected exit status 0, got ${status}: ${stdout} ${stderr}`,
61+
);
5862
assert.match(stdout, /Auto-linking Node-API modules/);
5963
});
6064
});

0 commit comments

Comments
 (0)