Commit d868d07c authored by Hunter Loftis's avatar Hunter Loftis

Merge pull request #147 from heroku/yoga-optional-deps

test for NPM_CONFIG_OPTIONAL and debug output for all npm config vars
parents 9d46aaf1 5918ee7a
......@@ -80,7 +80,7 @@ info "node_modules cached: $modules_cached"
echo ""
info "NPM_CONFIG_PRODUCTION=$NPM_CONFIG_PRODUCTION"
printenv | grep NPM_CONFIG | indent
info "DISABLE_BUILD_CACHE=$DISABLE_BUILD_CACHE"
source $bp_dir/bin/warnings.sh
......
......@@ -188,6 +188,32 @@ testDevDependencies() {
assertCapturedSuccess
}
testOptionalDependencies() {
env_dir=$(mktmpdir)
#echo "true" > $env_dir/NPM_CONFIG_OPTIONAL
compile "optional-dependencies" "$(mktmpdir)" $env_dir
assertNotCaptured "NPM_CONFIG_OPTIONAL"
assertCaptured "less"
assertCaptured "mime"
assertCaptured "mkdirp"
assertCaptured "clean-css"
assertCaptured "request"
assertCapturedSuccess
}
testNoOptionalDependencies() {
env_dir=$(mktmpdir)
echo "false" > $env_dir/NPM_CONFIG_OPTIONAL
compile "optional-dependencies" "$(mktmpdir)" $env_dir
assertCaptured "NPM_CONFIG_OPTIONAL=false"
assertCaptured "less"
assertNotCaptured "mime"
assertNotCaptured "mkdirp"
assertNotCaptured "clean-css"
assertNotCaptured "request"
assertCapturedSuccess
}
testDisableCache() {
cache=$(mktmpdir)
env_dir=$(mktmpdir)
......
A fake README, to keep npm from polluting stderr.
\ No newline at end of file
{
"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": {
"less": "1.7.0"
},
"engines": {
"node": "0.10.x"
},
"scripts": {
"start": "node foo.js"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment