test: Ignore the ~/.npmrc file during tests

When the test are run npm read the ~/.npmrc and ./.npmrc files and set some environment variables starting with `npm_`.
When the test create temporary folders and created a `.npmrc` the values there are ignored as the environment variables take precedence.
This commit remove this environment variable (from the local `process.env`) before starting the integrations test and restore them after. This way the `./.npmrc` files created in temp directory for the test are correctly used.
This commit is contained in:
Pierre Vanduynslager
2017-11-25 14:50:44 -05:00
parent 40c58c9b42
commit ce3841f553
2 changed files with 20 additions and 2 deletions
+1
View File
@@ -21,6 +21,7 @@ install:
- travis_retry npm install
script:
- git config --get user.email
- npm run test
after_success: