Commit 3c6fd89f authored by Hunter Loftis's avatar Hunter Loftis

test and implementation for econnreset warnings

parent db801a04
...@@ -43,7 +43,7 @@ handle_failure() { ...@@ -43,7 +43,7 @@ handle_failure() {
warn_untracked_dependencies "$LOG_FILE" warn_untracked_dependencies "$LOG_FILE"
warn_angular_resolution "$LOG_FILE" warn_angular_resolution "$LOG_FILE"
warn_missing_devdeps "$LOG_FILE" warn_missing_devdeps "$LOG_FILE"
warn_no_start "$LOG_FILE" warn_econnreset "$LOG_FILE"
failure_message | output "$LOG_FILE" failure_message | output "$LOG_FILE"
} }
trap 'handle_failure' ERR trap 'handle_failure' ERR
......
...@@ -121,3 +121,10 @@ warn_no_start() { ...@@ -121,3 +121,10 @@ warn_no_start() {
fi fi
fi fi
} }
warn_econnreset() {
local log_file="$1"
if grep -qi 'econnreset' "$log_file"; then
warning "ECONNRESET issues may be related to npm versions" "https://github.com/npm/registry/issues/10#issuecomment-217141066"
fi
}
{
"name": "econnreset-mock",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node server.js",
"postinstall": "echo 'npm ERR! network read ECONNRESET' && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
#!/usr/bin/env bash #!/usr/bin/env bash
# See README.md for info on running these tests. # See README.md for info on running these tests.
testWarnEconnreset() {
compile "econnreset-mock"
assertCaptured "may be related to npm versions"
assertCapturedError
compile "no-version"
assertNotCaptured "may be related to npm versions"
assertCapturedSuccess
}
testWarnNoStart() { testWarnNoStart() {
compile "no-start" compile "no-start"
assertCaptured "may not specify any way to start" assertCaptured "may not specify any way to start"
......
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