File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ export const options = {
349349 type : 'boolean' ,
350350 } ,
351351 notifyMode : {
352- default : undefined ,
352+ default : 'always' ,
353353 description : 'Specifies when notifications will appear for test results.' ,
354354 type : 'string' ,
355355 } ,
Original file line number Diff line number Diff line change @@ -40,12 +40,13 @@ export default class NotifyReporter extends BaseReporter {
4040 const success =
4141 result . numFailedTests === 0 && result . numRuntimeErrorTestSuites === 0 ;
4242
43+ const notifyMode = this . _globalConfig . notifyMode ;
44+
4345 if (
4446 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 ) ) )
4950 ) {
5051 const title = util . format ( '%d%% Passed' , 100 ) ;
5152 const message = util . format (
@@ -58,10 +59,9 @@ export default class NotifyReporter extends BaseReporter {
5859 this . _firstRun = false ;
5960 } else if (
6061 ! 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 ) ) )
6565 ) {
6666 const failed = result . numFailedTests / result . numTotalTests ;
6767
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ export default ({
5858 name : 'string' ,
5959 noStackTrace : false ,
6060 notify : false ,
61+ notifyMode : 'always' ,
6162 onlyChanged : false ,
6263 preset : 'react-native' ,
6364 projects : [ 'project-a' , 'project-b/' ] ,
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ export type Argv = {|
5353 noSCM : boolean ,
5454 noStackTrace : boolean ,
5555 notify : boolean ,
56+ notifyMode : string ,
5657 onlyChanged : boolean ,
5758 outputFile : string ,
5859 preset : ?string ,
You can’t perform that action at this time.
0 commit comments