Commit 937459c6 authored by Hunter Loftis's avatar Hunter Loftis

renamed PRO TIP to WARNING

parent 10422d15
...@@ -21,7 +21,7 @@ testDetectWithoutPackageJson() { ...@@ -21,7 +21,7 @@ testDetectWithoutPackageJson() {
testNoVersion() { testNoVersion() {
compile "no-version" compile "no-version"
assertCaptured "Node engine: unspecified" assertCaptured "Node engine: unspecified"
assertCaptured "PRO TIP: Specify a node version in package.json" assertCaptured "WARNING: Node version not specified in package.json"
assertCaptured "Resolving node version (latest stable) via semver.io" assertCaptured "Resolving node version (latest stable) via semver.io"
assertCaptured "Downloading and installing node 0.10" assertCaptured "Downloading and installing node 0.10"
assertCapturedSuccess assertCapturedSuccess
...@@ -37,7 +37,7 @@ testSpecificVersion() { ...@@ -37,7 +37,7 @@ testSpecificVersion() {
testStableVersion() { testStableVersion() {
compile "stable-node" compile "stable-node"
assertCaptured "Downloading and installing node 0.10" assertCaptured "Downloading and installing node 0.10"
assertNotCaptured "PRO TIP" assertNotCaptured "WARNING"
assertCapturedSuccess assertCapturedSuccess
} }
...@@ -50,7 +50,7 @@ testUnstableVersion() { ...@@ -50,7 +50,7 @@ testUnstableVersion() {
testOldNpm() { testOldNpm() {
compile "old-npm" compile "old-npm"
assertCaptured "PRO TIP: This version of npm has several known issues." assertCaptured "WARNING: This version of npm has several known issues."
assertCapturedSuccess assertCapturedSuccess
} }
...@@ -66,7 +66,7 @@ testInfoEmpty() { ...@@ -66,7 +66,7 @@ testInfoEmpty() {
testDangerousRangeStar() { testDangerousRangeStar() {
compile "dangerous-range-star" compile "dangerous-range-star"
assertCaptured "PRO TIP: Avoid semver ranges like '*'" assertCaptured "WARNING: Avoid semver ranges like '*'"
assertCaptured "Node engine: *" assertCaptured "Node engine: *"
assertCaptured "Resolving node version * via semver.io" assertCaptured "Resolving node version * via semver.io"
assertCaptured "Downloading and installing node 0.10" assertCaptured "Downloading and installing node 0.10"
...@@ -75,7 +75,7 @@ testDangerousRangeStar() { ...@@ -75,7 +75,7 @@ testDangerousRangeStar() {
testDangerousRangeGreaterThan() { testDangerousRangeGreaterThan() {
compile "dangerous-range-greater-than" compile "dangerous-range-greater-than"
assertCaptured "PRO TIP: Avoid semver ranges starting with '>'" assertCaptured "WARNING: Avoid semver ranges starting with '>'"
assertCaptured "Resolving node version >0.4 via semver.io" assertCaptured "Resolving node version >0.4 via semver.io"
assertCaptured "Downloading and installing node 0.10" assertCaptured "Downloading and installing node 0.10"
assertCapturedSuccess assertCapturedSuccess
...@@ -173,7 +173,7 @@ testProcfileAbsentServerPresent() { ...@@ -173,7 +173,7 @@ testProcfileAbsentServerPresent() {
testServerPresentOnly() { testServerPresentOnly() {
compile "server-present-only" compile "server-present-only"
assertCaptured "PRO TIP: Use 'npm init'" assertCaptured "WARNING: No package.json found"
assertCaptured "Skipping dependencies" assertCaptured "Skipping dependencies"
assertCaptured "'web: node server.js' to new Procfile" assertCaptured "'web: node server.js' to new Procfile"
assertFile "web: node server.js" "Procfile" assertFile "web: node server.js" "Procfile"
......
protip() { warning() {
tip=$1 tip=$1
url=$2 url=$2
echo "PRO TIP: $tip" >> $warnings echo "WARNING: $tip" >> $warnings
echo "${url:-https://devcenter.heroku.com/articles/nodejs-support}" >> $warnings echo "${url:-https://devcenter.heroku.com/articles/nodejs-support}" >> $warnings
echo "" >> $warnings
} }
if [ "$node_engine" == "" ]; then if [ "$node_engine" == "" ]; then
protip "Specify a node version in package.json" "https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version" warning "Node version not specified in package.json" "https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version"
elif [ "$node_engine" == "*" ]; then elif [ "$node_engine" == "*" ]; then
protip "Avoid semver ranges like '*' in engines.node" "https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version" warning "Avoid semver ranges like '*' in engines.node" "https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version"
elif [ ${node_engine:0:1} == ">" ]; then elif [ ${node_engine:0:1} == ">" ]; then
protip "Avoid semver ranges starting with '>' in engines.node" "https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version" warning "Avoid semver ranges starting with '>' in engines.node" "https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version"
fi fi
if [ "$modules_source" == "prebuilt" ]; then if [ "$modules_source" == "prebuilt" ]; then
protip "Avoid checking node_modules into source control" "https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-" warning "Avoid checking node_modules into source control" "https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-"
elif [ "$modules_source" == "" ]; then elif [ "$modules_source" == "" ]; then
protip "Use 'npm init' and 'npm install --save' to define dependencies" warning "No package.json found"
fi fi
if [ "$start_method" == "" ]; then if [ "$start_method" == "" ]; then
protip "Include a Procfile, package.json start script, or server.js file to start your app" "https://devcenter.heroku.com/articles/nodejs-support#runtime-behavior" warning "No Procfile, package.json start script, or server.js file found" "https://devcenter.heroku.com/articles/nodejs-support#runtime-behavior"
fi fi
if [ "$npm_engine" != "" ]; then if [ "$npm_engine" != "" ]; then
if [ "${npm_engine:0:1}" -lt "2" ]; then if [ "${npm_engine:0:1}" -lt "2" ]; then
protip "This version of npm has several known issues. You should consider upgrading to the latest release." warning "This version of npm has several known issues. You should consider upgrading to the latest release."
fi fi
fi fi
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