Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: better logging for test/test-addon.js
  • Loading branch information
refack committed Jul 26, 2019
commit b9afb43b344c121102bd4abb09b678ade1d7dbcd
8 changes: 6 additions & 2 deletions test/test-addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ function checkCharmapValid () {
}

test('build simple addon', function (t) {
t.plan(3)
t.plan(2)

// Set the loglevel otherwise the output disappears when run via 'npm test'
var cmd = [ nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose' ]
var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) {
if (err) {
console.error('failed to run: ' + cmd.join(' '))
console.log(stderr)
t.fail(err)
}
var logLines = stderr.toString().trim().split(/\r?\n/)
var lastLine = logLines[logLines.length - 1]
t.strictEqual(err, null)
t.strictEqual(lastLine, 'gyp info ok', 'should end in ok')
t.strictEqual(runHello().trim(), 'world')
})
Expand Down