Skip to content

Commit

Permalink
Updated a test to avoid a freak event firing (???). Refs #58.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhop committed Aug 30, 2019
1 parent 9c39e30 commit cf72edf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_verifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,17 @@ unit.add(module, [
verifier = new Verifier({jsonStreaming: true}),
pipeline = ReadString.make(input).pipe(verifier);

let gotError = false;
pipeline.on('error', function(error) {
gotError = true;
eval(t.TEST('error.line === 1 && error.pos === 3 && error.offset === 2'));
async.done();
});
pipeline.on('finish', function() {
t.test(!"We shouldn't be here!");
async.done();
if (!gotError) {
t.test(!"We shouldn't be here!");
async.done();
}
});
}
]);

0 comments on commit cf72edf

Please sign in to comment.