mirror of
https://github.com/drone-plugins/drone-npm.git
synced 2026-06-04 18:23:52 +08:00
Fix for default case of using GlobalRegistry
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user