Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reject waitUntil if process exits #11909

Merged
merged 2 commits into from
Sep 29, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
point to waitUntil
SimenB committed Sep 29, 2021
commit 3d32b76e1016eec96358718a721b6dfcd9be1f26
10 changes: 8 additions & 2 deletions e2e/runJest.ts
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ import * as fs from 'graceful-fs';
import stripAnsi = require('strip-ansi');
import type {FormattedTestResults} from '@jest/test-result';
import type {Config} from '@jest/types';
import {ErrorWithStack} from 'jest-util';
import {normalizeIcons} from './Utils';

const JEST_PATH = path.resolve(__dirname, '../packages/jest-cli/bin/jest.js');
@@ -212,7 +213,7 @@ export const runContinuous = function (
}),
);

return {
const continuousRun = {
async end() {
jestPromise.kill();

@@ -242,12 +243,17 @@ export const runContinuous = function (
resolve();
}
};
const error = new Error('Process exited');
const error = new ErrorWithStack(
'Process exited',
continuousRun.waitUntil,
);
Comment on lines +246 to +249
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create the error here to point back to the waitUntil

image

pendingRejection.set(check, () => reject(error));
pending.add(check);
});
},
};

return continuousRun;
};

// return type matches output of logDebugMessages