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

fix: notifications should be fire&forget rather than having a timeout #9567

Merged
merged 4 commits into from Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,7 @@
- `[jest-config]` Support `.mjs` config files on Windows as well ([#9558](https://github.com/facebook/jest/pull/9558))
- `[jest-cli]` Set `coverageProvider` correctly when provided in config ([#9562](https://github.com/facebook/jest/pull/9562))
- `[jest-matcher-utils]` Fix diff highlight of symbol-keyed object. ([#9499](https://github.com/facebook/jest/pull/9499))
- `[@jest/reporters]` Notifications should be fire&forget rather than having a timeout ([#9567](https://github.com/facebook/jest/pull/9567))
- `[jest-resolve]` Fix module identity preservation with symlinks and browser field resolution ([#9511](https://github.com/facebook/jest/pull/9511))
- `[jest-resolve]` Do not confuse directories with files ([#8912](https://github.com/facebook/jest/pull/8912))
- `[jest-resolve]` `moduleNameMapper` should take precedence over Node core modules ([#9563](https://github.com/facebook/jest/pull/9563))
Expand Down
11 changes: 7 additions & 4 deletions packages/jest-reporters/src/notify_reporter.ts
Expand Up @@ -78,7 +78,8 @@ export default class NotifyReporter extends BaseReporter {
result.numPassedTests,
);

this._notifier.notify({icon, message, title});
// @ts-ignore: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42303
this._notifier.notify({icon, message, timeout: false, title});
} else if (
testsHaveRun &&
!success &&
Expand Down Expand Up @@ -106,17 +107,19 @@ export default class NotifyReporter extends BaseReporter {
const quitAnswer = 'Exit tests';

if (!watchMode) {
this._notifier.notify({icon, message, title});
// @ts-ignore: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42303
this._notifier.notify({icon, message, timeout: false, title});
} else {
this._notifier.notify(
{
actions: [restartAnswer, quitAnswer],
closeLabel: 'Close',
icon,
message,
timeout: 10,
timeout: false,
title,
},
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42303
} as any,
(err, _, metadata) => {
if (err || !metadata) {
return;
Expand Down