Commit 3740fae7 authored by Terence Lee's avatar Terence Lee

add a test for using cache_directories option in package.json

parent 0cdb3964
A fake README, to keep npm from polluting stderr.
\ No newline at end of file
{
"name": "node-buildpack-test-app",
"dependencies": {
"jquery": "^1.11.1"
}
}
{
"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"
},
"engines": {
"node": "0.10.18"
},
"dependencies": {
"bower": "1.3.12"
},
"scripts": {
"postinstall": "bower install --allow-root"
},
"cache_directories": ["bower_components", "node_modules"]
}
......@@ -172,6 +172,18 @@ testBuildWithCache() {
assertCapturedSuccess
}
testBuildWithUserCacheDirectories() {
cache=$(mktmpdir)
compile "cache-directories" $cache
assertCapturedSuccess
assertEquals "1" "$(ls -1 $cache/node | grep bower_components | wc -l)"
assertEquals "1" "$(ls -1 $cache/node | grep node_modules | wc -l)"
compile "cache-directories" $cache
assertCaptured "Loading user cache directory from cache: bower_components"
assertCapturedSuccess
}
testModulesCheckedIn() {
compile "modules-checked-in"
assertCaptured "node_modules source: prebuilt"
......
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