From 7e1a6a90bb2f29375941b44c0e1c77da9de0130f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 18 Nov 2024 03:20:45 -0800 Subject: [PATCH] Filter out AppRegistry logs from output (#47658) Summary: Changelog: [internal] AppRegistry logs are showing up again in Fantom because we changed the order and now they're not necessarily showing up last. This fixes that by filtering them out in any position. Differential Revision: D66094274 --- jest/integration/runner/runner.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/jest/integration/runner/runner.js b/jest/integration/runner/runner.js index 3bd61955d26f26..31089f1e79640f 100644 --- a/jest/integration/runner/runner.js +++ b/jest/integration/runner/runner.js @@ -30,15 +30,10 @@ function parseRNTesterCommandResult( ): {logs: string, testResult: TestSuiteResult} { const stdout = result.stdout.toString(); - const outputArray = stdout.trim().split('\n'); - - // Remove AppRegistry logs at the end - while ( - outputArray.length > 0 && - outputArray[outputArray.length - 1].startsWith('Running "') - ) { - outputArray.pop(); - } + const outputArray = stdout + .trim() + .split('\n') + .filter(log => !log.startsWith('Running "')); // remove AppRegistry logs. // The last line should be the test output in JSON format const testResultJSON = outputArray.pop();