Skip to content

Commit

Permalink
e2e: ignore "missing test" error
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Mar 26, 2024
1 parent 9cccc36 commit 9f46f4b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/libs/E2E/reactNativeLaunchingTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ E2EClient.getTestConfig()
return E2EClient.submitTestResults({
name: config.name,
error: `Test '${config.name}' not found`,
critical: false,
});
}

Expand Down
6 changes: 6 additions & 0 deletions src/libs/E2E/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ type TestResult = {
/** Optional, if set indicates that the test run failed and has no valid results. */
error?: string;

/**
* Whether error is critical. If `true`, then server will be stopped and `e2e` tests will fail. Otherwise will simply log a warning.
* Default value is `true`
*/
critical?: boolean;

/** Render count */
renderCount?: number;
};
Expand Down
7 changes: 6 additions & 1 deletion tests/e2e/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,14 @@ const runTests = async (): Promise<void> => {

// Collect results while tests are being executed
server.addTestResultListener((testResult) => {
if (testResult?.error != null) {
const {critical = true} = testResult;

if (testResult?.error != null && critical) {
throw new Error(`Test '${testResult.name}' failed with error: ${testResult.error}`);
}
if (testResult?.error != null && !critical) {
Logger.warn(`Test '${testResult.name}' failed with error: ${testResult.error}`);
}
let result = 0;

if (testResult?.duration !== undefined) {
Expand Down

0 comments on commit 9f46f4b

Please sign in to comment.