Skip to content

Commit

Permalink
Merge pull request #275 from raddevon/patch-1
Browse files Browse the repository at this point in the history
Ensures errors in stdoutEqual callback are logged
  • Loading branch information
vladikoff committed Oct 20, 2020
2 parents 03f4302 + 7a6fec4 commit fc210e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/jshint_test.js
Expand Up @@ -21,7 +21,12 @@ var stdoutEqual = function(callback, done) {
}
});
// Execute the logging code to be tested.
callback();
try {
callback();
} catch (error) {
hooker.unhook(process.stdout, 'write');
throw error;
}
// Restore process.stdout.write to its original value.
hooker.unhook(process.stdout, 'write');
// Actually test the actually-logged stdout string to the expected value.
Expand Down

0 comments on commit fc210e7

Please sign in to comment.