Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensures errors in stdoutEqual callback are logged #275

Merged
merged 1 commit into from Oct 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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