diff --git a/e2e/__tests__/fatalWorkerError.test.ts b/e2e/__tests__/fatalWorkerError.test.ts index b2e6bf9ed00e..72a49181b428 100644 --- a/e2e/__tests__/fatalWorkerError.test.ts +++ b/e2e/__tests__/fatalWorkerError.test.ts @@ -37,8 +37,12 @@ test('fails a test that terminates the worker with a fatal error', () => { 'package.json': '{}', }); - const {status, stderr} = runJest(DIR); - expect(status).toBe(1); + const {status, stderr} = runJest(DIR, ['--maxWorkers=2']); + + const numberOfTestsPassed = (stderr.match(/\bPASS\b/g) || []).length; + + expect(status).not.toBe(0); + expect(numberOfTestsPassed).toBe(Object.keys(testFiles).length - 1); expect(stderr).toContain('FAIL __tests__/fatalWorkerError.test.js'); expect(stderr).toContain('Call retries were exceeded'); });