Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: two-thirds of npm-defaults.js doesn't work #34

Open
kenany opened this issue Apr 10, 2015 · 0 comments
Open

tests: two-thirds of npm-defaults.js doesn't work #34

kenany opened this issue Apr 10, 2015 · 0 comments

Comments

@kenany
Copy link

kenany commented Apr 10, 2015

Changing the input configs of two of npm-defaults.js tests do not make the test fail:

diff --git a/test/npm-defaults.js b/test/npm-defaults.js
index 666e9a1..06a2221 100644
--- a/test/npm-defaults.js
+++ b/test/npm-defaults.js
@@ -55,7 +55,7 @@ test("npm configuration values pulled from dotted config", function (t) {
   var config = {
     yes : "yes",

-    "init.author.name"  : "npmbot",
+    "init.author.name"  : "kenan",
     "init.author.email" : "n@p.m",
     "init.author.url"   : "http://npm.im",

@@ -81,7 +81,7 @@ test("npm configuration values pulled from dashed config", function (t) {
   var config = {
     yes : "yes",

-    "init-author-name"  : "npmbot",
+    "init-author-name"  : "kenan",
     "init-author-email" : "n@p.m",
     "init-author-url"   : "http://npm.im",

AFAICT, this is because npm.load() caches a loaded boolean and as such only its first execution here determines the config used in all the tests in this file. The other npm.load()s change nothing, so it seems to me like these tests aren't actually testing what they should be testing.

I spent some time this morning trying to work around this but I'm at a lost now :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant