Commit d020d2a2 authored by Hunter Loftis's avatar Hunter Loftis

test and implementation for failing on incorrectly formatted json; new vendor/jq

parent 7084667a
......@@ -2,9 +2,10 @@
####### Configure environment
set -e # fail fast
set -o pipefail # don't ignore exit codes when piping output
set -o errexit # always exit on error
set -o errtrace # trap errors in functions as well
set -o pipefail # don't ignore exit codes when piping output
set -o posix # more strict failures in subshells
# set -x # enable debugging
# Configure directories
......
......@@ -18,6 +18,15 @@ testDetectWithoutPackageJson() {
assertCapturedError 1 ""
}
testBadJson() {
compile "bad-json"
assertCaptured "Build failed"
assertCaptured "We're sorry this build is failing"
assertNotCaptured "build directory..."
assertNotCaptured "Installing binaries"
assertCapturedError 1 ""
}
testIoJs() {
compile "iojs"
assertCaptured "Node engine: 1.0."
......@@ -92,8 +101,10 @@ testNpmVersionSpecific() {
testFailingBuild() {
compile "failing-build"
assertCaptured "Building dependencies"
assertCaptured "Build failed"
assertCaptured "We're sorry this build is failing"
assertNotCaptured "Checking startup method"
assertCapturedError 1 ""
}
......
......@@ -39,12 +39,7 @@ read_json() {
local file=$1
local node=$2
if test -f $file; then
local result="$(cat $file | $bp_dir/vendor/jq -r $node)"
if [ "$result" == "null" ]; then
echo ""
else
echo "$result"
fi
cat $file | $bp_dir/vendor/jq --raw-output "$node // \"\"" || return 1
else
echo ""
fi
......
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": {
"hashish": "*"
"express": "*"
},
"engines": {
"node": "0.10.29"
}
}
No preview for this file type
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