Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Oct 25, 2016
1 parent dee9fc4 commit d4cacf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ Test.prototype._runChild = function runChild (child, name, extra, cb) {
self._ending = true
}

// console.error('child ok=%j', child._ok, child._buffer, child._fails)
self.ok(child._ok, child._name + ' {', { diagnostic: false })
var b = child._buffer.trim().split('\n').join('\n ') + '\n'
b = b.split('\n \n').join('\n\n')
Expand Down Expand Up @@ -1033,9 +1034,10 @@ function bailOnFail (self, stream, parser, root) {
})

parser.on('assert', function (res) {
if (!res.todo && !res.skip && !res.ok) {
if (!res.todo && !res.skip && !res.ok && res.name.slice(-1) !== '{') {
// console.error('bail %j', res.name)
var ind = new Array(parser.level + 1).join(' ')
var line = ind + 'Bail out! # ' + res.name + '\n'
var line = ind + 'Bail out! # ' + res.name.trim() + '\n'
root.buffer = ''
root.write(line)
}
Expand Down Expand Up @@ -1435,7 +1437,7 @@ Test.prototype.printResult = function printResult (ok, message, extra) {
this.writeDiags(extra)
}

if (this._bail && !ok && !extra.skip && !extra.todo) {
if (this._bail && !ok && !extra.skip && !extra.todo && message.slice(-1) !== '{') {
this.bailout(message.replace(/^ - /, ''))
}

Expand Down Expand Up @@ -1655,6 +1657,8 @@ Test.prototype.bailout = function (message) {
child.bailout(message)
}

// console.trace('bailout', message)

message = message ? ' # ' + ('' + message).trim() : ''
message = message.replace(/^( #)+ /, ' # ')
message = message.replace(/[\r\n]/g, ' ')
Expand Down
1 change: 1 addition & 0 deletions test/require-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ test('compile-to-js require hook', function (t) {
t.plan(6)

function verifyOutput (err, stdout, stderr) {
console.error(stdout)
t.ok(!!err, 'Should have failed to run')
t.match(stdout, /file: .*[\\\/]using-require-hook\.faux/,
'error happened in the *.faux file')
Expand Down

0 comments on commit d4cacf0

Please sign in to comment.