Commit ac90f3ea authored by Hunter Loftis's avatar Hunter Loftis

test and implementation for cacheDirectories (camelCase)

parent 84921057
...@@ -299,6 +299,11 @@ cache_directories() { ...@@ -299,6 +299,11 @@ cache_directories() {
if [ "$check" != -1 ]; then if [ "$check" != -1 ]; then
result=$(read_json "$package_json" "$key[]") result=$(read_json "$package_json" "$key[]")
fi fi
local key=".cacheDirectories"
local check=$(key_exist $package_json $key)
if [ "$check" != -1 ]; then
result=$(read_json "$package_json" "$key[]")
fi
echo $result echo $result
} }
......
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"
},
"cacheDirectories": ["bower_components", "node_modules"]
}
...@@ -186,6 +186,20 @@ testBuildWithUserCacheDirectories() { ...@@ -186,6 +186,20 @@ testBuildWithUserCacheDirectories() {
assertCapturedSuccess assertCapturedSuccess
} }
testBuildWithUserCacheDirectoriesCamel() {
cache=$(mktmpdir)
compile "cache-directories-camel" $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 "Restoring 2 directories from cache:"
assertCaptured "- bower_components"
assertCaptured "Restoring node modules from cache"
assertCapturedSuccess
}
testModulesCheckedIn() { testModulesCheckedIn() {
compile "modules-checked-in" compile "modules-checked-in"
assertCaptured "node_modules source: prebuilt" 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