Skip to content

Commit

Permalink
test and implementation for unmet dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterloftis committed Jun 30, 2016
1 parent 1ecc9dc commit b5001ae
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/compile
Expand Up @@ -162,3 +162,4 @@ header "Build succeeded!"
summarize_build | output "$LOG_FILE"

warn_no_start "$LOG_FILE"
warn_unmet_dep "$LOG_FILE"
7 changes: 7 additions & 0 deletions lib/failure.sh
Expand Up @@ -128,3 +128,10 @@ warn_econnreset() {
warning "ECONNRESET issues may be related to npm versions" "https://github.com/npm/registry/issues/10#issuecomment-217141066"
fi
}

warn_unmet_dep() {
local log_file="$1"
if grep -qi 'unmet dependency' "$log_file" || grep -qi 'unmet peer dependency' "$log_file"; then
warn "Unmet dependencies don't fail npm install but may cause runtime issues" "https://github.com/npm/npm/issues/7494"
fi
}
15 changes: 15 additions & 0 deletions test/fixtures/unmet-dep/package.json
@@ -0,0 +1,15 @@
{
"name": "unmet-dep",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node server.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"grunt-steroids": "0.2.3"
}
}
9 changes: 9 additions & 0 deletions test/run
@@ -1,6 +1,15 @@
#!/usr/bin/env bash
# See README.md for info on running these tests.

testWarnUnmetDep() {
compile "unmet-dep"
assertCaptured "may cause runtime issues"
assertCapturedSuccess
compile "no-version"
assertNotCaptured "may cause runtime issues"
assertCapturedSuccess
}

testWarnEconnreset() {
compile "econnreset-mock"
assertCaptured "may be related to npm versions"
Expand Down

0 comments on commit b5001ae

Please sign in to comment.