File tree Expand file tree Collapse file tree
packages/cli/src/commands/publish Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,12 +46,12 @@ describe("getCorrectRegistry", () => {
4646 process . env [ "npm_config_@acme:registry" ] =
4747 "https://registry.example.com/acme" ;
4848
49- expect (
50- getCorrectRegistry ( { name : "@acme/pkg" , version : "1.0.0" } )
51- ) . toEqual ( {
52- scope : "@ acme" ,
53- registry : "https://registry.example.com/acme" ,
54- } ) ;
49+ expect ( getCorrectRegistry ( { name : "@acme/pkg" , version : "1.0.0" } ) ) . toEqual (
50+ {
51+ scope : "@acme" ,
52+ registry : "https://registry.example.com/ acme" ,
53+ }
54+ ) ;
5555 } ) ;
5656
5757 it ( "uses publishConfig.registry when provided" , ( ) => {
@@ -82,7 +82,9 @@ describe("getCorrectRegistry", () => {
8282 it ( "preserves registry URLs that already end with a slash" , ( ) => {
8383 process . env . npm_config_registry = "https://nexus.example.com/npm/" ;
8484
85- expect ( getCorrectRegistry ( ) . registry ) . toBe ( "https://nexus.example.com/npm/" ) ;
85+ expect ( getCorrectRegistry ( ) . registry ) . toBe (
86+ "https://nexus.example.com/npm/"
87+ ) ;
8688 } ) ;
8789
8890 it ( "preserves query params and hashes exactly" , ( ) => {
Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ export function getCorrectRegistry(packageJson?: PackageJSON): RegistryInfo {
7676
7777 return {
7878 scope : undefined ,
79- registry : ! isCustomRegistry ( registry ) ? NPM_REGISTRY : registry ,
79+ registry :
80+ ! registry || ! isCustomRegistry ( registry ) ? NPM_REGISTRY : registry ,
8081 } ;
8182}
8283
You can’t perform that action at this time.
0 commit comments