File tree 2 files changed +31
-1
lines changed
2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ class PublishCommand extends Command {
212
212
}
213
213
214
214
if ( this . project . isIndependent ( ) ) {
215
- return taggedPackageNames . map ( name => this . packageGraph . get ( name ) ) ;
215
+ return taggedPackageNames . map ( name => this . packageGraph . get ( name ) ) . filter ( name => name !== undefined ) ;
216
216
}
217
217
218
218
return getTaggedPackages ( this . packageGraph , this . project . rootPath , this . execOpts ) ;
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+
3
+ const path = require ( "path" ) ;
4
+
5
+ const cliRunner = require ( "@lerna-test/cli-runner" ) ;
6
+ const gitTag = require ( "@lerna-test/git-tag" ) ;
7
+ const cloneFixture = require ( "@lerna-test/clone-fixture" ) (
8
+ path . resolve ( __dirname , "../commands/publish/__tests__" )
9
+ ) ;
10
+
11
+ // stabilize changelog commit SHA and datestamp
12
+ expect . addSnapshotSerializer ( require ( "@lerna-test/serialize-changelog" ) ) ;
13
+
14
+ const env = {
15
+ // never actually upload when calling `npm publish`
16
+ npm_config_dry_run : true ,
17
+ // skip npm package validation, none of the stubs are real
18
+ LERNA_INTEGRATION : "SKIP" ,
19
+ } ;
20
+
21
+ test ( "lerna publish from-git handles custom tags" , async ( ) => {
22
+ const { cwd } = await cloneFixture ( "independent" ) ;
23
+
24
+ await gitTag ( cwd , "some-unrelated-tag" ) ;
25
+
26
+ const args = [ "publish" , "--yes" , "from-git" ] ;
27
+
28
+ const { stdout } = await cliRunner ( cwd , env ) ( ...args ) ;
29
+ expect ( stdout ) . toMatchInlineSnapshot ( "" , `` ) ;
30
+ } ) ;
You can’t perform that action at this time.
0 commit comments