Fix for default case of using GlobalRegistry

This commit is contained in:
tlee21
2019-10-29 14:35:16 +08:00
parent a0c0610666
commit 183558183a
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ type (
)
// GlobalRegistry defines the default NPM registry.
const GlobalRegistry = "https://registry.npmjs.org"
const GlobalRegistry = "https://registry.npmjs.org/"
// Exec executes the plugin.
func (p Plugin) Exec() error {
+7
View File
@@ -21,4 +21,11 @@ func TestTokenRCContents(t *testing.T) {
if actual != expected {
t.Errorf("Unexpected token config (Got: %s, Expected: %s)", actual, expected)
}
conf.Registry = GlobalRegistry
actual = npmrcContentsToken(conf)
expected = "//registry.npmjs.org/:_authToken=token"
if actual != expected {
t.Errorf("Unexpected token config (Got: %s, Expected: %s)", actual, expected)
}
}