File tree 4 files changed +11
-9
lines changed
4 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ export const options = {
349
349
type : 'boolean' ,
350
350
} ,
351
351
notifyMode : {
352
- default : undefined ,
352
+ default : 'always' ,
353
353
description : 'Specifies when notifications will appear for test results.' ,
354
354
type : 'string' ,
355
355
} ,
Original file line number Diff line number Diff line change @@ -40,12 +40,13 @@ export default class NotifyReporter extends BaseReporter {
40
40
const success =
41
41
result . numFailedTests === 0 && result . numRuntimeErrorTestSuites === 0 ;
42
42
43
+ const notifyMode = this . _globalConfig . notifyMode ;
44
+
43
45
if (
44
46
success &&
45
- ( this . _globalConfig === 'always' ||
46
- this . _globalConfig === 'success' ||
47
- ( this . _globalConfig === 'change' &&
48
- ( ! this . _previousSuccess || this . _firstRun ) ) )
47
+ ( notifyMode === 'always' ||
48
+ notifyMode === 'success' ||
49
+ ( notifyMode === 'change' && ( ! this . _previousSuccess || this . _firstRun ) ) )
49
50
) {
50
51
const title = util . format ( '%d%% Passed' , 100 ) ;
51
52
const message = util . format (
@@ -58,10 +59,9 @@ export default class NotifyReporter extends BaseReporter {
58
59
this . _firstRun = false ;
59
60
} else if (
60
61
! success &&
61
- ( this . _globalConfig === 'always' ||
62
- this . _globalConfig === 'failure' ||
63
- ( this . _globalConfig === 'change' &&
64
- ( this . _previousSuccess || this . _firstRun ) ) )
62
+ ( notifyMode === 'always' ||
63
+ notifyMode === 'failure' ||
64
+ ( notifyMode === 'change' && ( this . _previousSuccess || this . _firstRun ) ) )
65
65
) {
66
66
const failed = result . numFailedTests / result . numTotalTests ;
67
67
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ export default ({
58
58
name : 'string' ,
59
59
noStackTrace : false ,
60
60
notify : false ,
61
+ notifyMode : 'always' ,
61
62
onlyChanged : false ,
62
63
preset : 'react-native' ,
63
64
projects : [ 'project-a' , 'project-b/' ] ,
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ export type Argv = {|
53
53
noSCM : boolean ,
54
54
noStackTrace : boolean ,
55
55
notify : boolean ,
56
+ notifyMode : string ,
56
57
onlyChanged : boolean ,
57
58
outputFile : string ,
58
59
preset : ?string ,
You can’t perform that action at this time.
0 commit comments