Skip to content

Commit ce9f711

Browse files
authored
Change notification to be transient (notify-send) (#11733)
1 parent 86fcd4d commit ce9f711

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
- `[jest-jasmine2, jest-types]` [**BREAKING**] Move all `jasmine` specific types from `@jest/types` to its own package ([#12125](https://github.com/facebook/jest/pull/12125))
5353
- `[jest-matcher-utils]` Pass maxWidth to `pretty-format` to avoid printing every element in arrays by default ([#12402](https://github.com/facebook/jest/pull/12402))
5454
- `[jest-mock]` Fix function overloads for `spyOn` to allow more correct type inference in complex object ([#12442](https://github.com/facebook/jest/pull/12442))
55+
- `[jest-reporters]` Notifications generated by the `--notify` flag are no longer persistent in GNOME Shell. ([#11733](https://github.com/facebook/jest/pull/11733))
5556

5657
### Chore & Maintenance
5758

packages/jest-reporters/src/NotifyReporter.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ export default class NotifyReporter extends BaseReporter {
8181
result.numPassedTests,
8282
)} passed`;
8383

84-
this._notifier.notify({icon, message, timeout: false, title});
84+
this._notifier.notify({
85+
hint: 'int:transient:1',
86+
icon,
87+
message,
88+
timeout: false,
89+
title,
90+
});
8591
} else if (
8692
testsHaveRun &&
8793
!success &&
@@ -109,12 +115,20 @@ export default class NotifyReporter extends BaseReporter {
109115
const quitAnswer = 'Exit tests';
110116

111117
if (!watchMode) {
112-
this._notifier.notify({icon, message, timeout: false, title});
118+
this._notifier.notify({
119+
hint: 'int:transient:1',
120+
icon,
121+
message,
122+
timeout: false,
123+
title,
124+
});
113125
} else {
114126
this._notifier.notify(
115127
{
128+
// @ts-expect-error - not all options are supported by all systems (specifically `actions` and `hint`)
116129
actions: [restartAnswer, quitAnswer],
117130
closeLabel: 'Close',
131+
hint: 'int:transient:1',
118132
icon,
119133
message,
120134
timeout: false,

0 commit comments

Comments
 (0)