Skip to content

Commit

Permalink
Add a test for custom .npmrc support
Browse files Browse the repository at this point in the history
  • Loading branch information
rykov committed Dec 8, 2013
1 parent f6d0b9c commit 991ceb9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ testModulesCheckedIn() {
assertCapturedSuccess
}

testUserConfig() {
compile "userconfig"
assertCaptured "https://www.google.com/"
assertCaptured "registry error"
assertCapturedError 1 ""
}

# Pending Tests

# testNodeBinariesAddedToPath() {
Expand Down Expand Up @@ -135,7 +142,7 @@ compile_dir=""

compile() {
compile_dir=$(mktmpdir)
cp -r ${bp_dir}/test/$1/* ${compile_dir}/
cp -r ${bp_dir}/test/$1/. ${compile_dir}
capture ${bp_dir}/bin/compile ${compile_dir} ${2:-$(mktmpdir)}
}

Expand Down
7 changes: 7 additions & 0 deletions test/userconfig/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; Any URL that throws 404s
registry = "https://www.google.com/"
strict-ssl = false
; Ensure fast failure
fetch-retries = 0
fetch-retry-factor = 0
fetch-retry-mintimeout = 0
1 change: 1 addition & 0 deletions test/userconfig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A fake README, to keep npm from polluting stderr.
15 changes: 15 additions & 0 deletions test/userconfig/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "node-buildpack-test-app",
"version": "0.0.1",
"description": "node buildpack integration test app",
"repository" : {
"type" : "git",
"url" : "http://github.com/example/example.git"
},
"dependencies": {
"something-not-in-cache": "*"
},
"engines": {
"node": "~0.10.0"
}
}

0 comments on commit 991ceb9

Please sign in to comment.