Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
test: give a little more info with registry test failure
PR-URL: #10903
Credit: @zkat
  • Loading branch information
zkat committed Jan 19, 2016
1 parent a9f6fe9 commit 75ab216
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions test/tap/registry.js
Expand Up @@ -38,11 +38,14 @@ function runTests () {
cwd: ca,
stdio: "inherit"
}
common.npm(["install"], opts, function (err, code) {
common.npm(["install"], opts, function (err, code, stdout, stderr) {
if (err) { throw err }
if (code) {
return test("need install to work", function (t) {
t.fail("install failed with: " + code)
t.fail(
"install failed with: " + code +
'\nstdout: ' + stdout +
'\nstderr: ' + stderr)
t.end()
})

Expand All @@ -52,24 +55,32 @@ function runTests () {
env: env,
stdio: "inherit"
}
common.npm(["test", "--", "-Rtap"], opts, function (err, code) {
if (err) { throw err }
if (code) {
return test("need test to work", function (t) {
t.fail("test failed with: " + code)
t.end()
common.npm(
[
"test", "--", "-Rtap"
],
opts,
function (err, code, stdout, stderr) {
if (err) { throw err }
if (code) {
return test("need test to work", function (t) {
t.fail(
"test failed with: " + code +
'\nstdout: ' + stdout +
'\nstderr: ' + stderr)
t.end()
})
}
opts = {
cwd: ca,
env: env,
stdio: "inherit"
}
common.npm(["prune", "--production"], opts, function (err, code) {
if (err) { throw err }
process.exit(code || 0)
})
})
}
opts = {
cwd: ca,
env: env,
stdio: "inherit"
}
common.npm(["prune", "--production"], opts, function (err, code) {
if (err) { throw err }
process.exit(code || 0)
})
})
}
})
}

0 comments on commit 75ab216

Please sign in to comment.