File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,9 @@ describe("RunCommand", () => {
126
126
127
127
await lernaRun ( testDir ) ( "missing-script" ) ;
128
128
129
- expect ( consoleOutput ( ) ) . toBe ( "" ) ;
129
+ expect ( loggingOutput ( "success" ) ) . toContain (
130
+ "No packages found with the lifecycle script 'missing-script'"
131
+ ) ;
130
132
} ) ;
131
133
132
134
it ( "runs a script in all packages with --parallel" , async ( ) => {
Original file line number Diff line number Diff line change @@ -47,7 +47,10 @@ class RunCommand extends Command {
47
47
}
48
48
49
49
if ( ! this . packagesWithScript . length ) {
50
- this . logger . warn ( `No packages found with the npm script '${ script } '` ) ;
50
+ this . logger . success ( "run" , `No packages found with the lifecycle script '${ script } '` ) ;
51
+
52
+ // still exits zero, aka "ok"
53
+ return false ;
51
54
}
52
55
53
56
if ( parallel || stream ) {
@@ -70,10 +73,8 @@ class RunCommand extends Command {
70
73
}
71
74
72
75
return chain . then ( ( ) => {
73
- if ( this . packagesWithScript . length ) {
74
- this . logger . success ( "run" , `Ran npm script '${ this . script } ' in packages:` ) ;
75
- this . logger . success ( "" , this . packagesWithScript . map ( pkg => `- ${ pkg . name } ` ) . join ( "\n" ) ) ;
76
- }
76
+ this . logger . success ( "run" , `Ran npm script '${ this . script } ' in packages:` ) ;
77
+ this . logger . success ( "" , this . packagesWithScript . map ( pkg => `- ${ pkg . name } ` ) . join ( "\n" ) ) ;
77
78
} ) ;
78
79
}
79
80
You can’t perform that action at this time.
0 commit comments