Files
taimed/node_modules/karma-jsdom-launcher/test/test-helper/intercept_stdout.js
2025-07-24 17:21:45 +08:00

21 lines
321 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
let intercept = require("intercept-stdout");
async function interceptStdout (options, fn) {
let unhook = intercept(function (data) {
if (options.passthrough) {
return data;
}
return '';
});
try {
return await fn();
} finally {
unhook();
}
}
module.exports = { interceptStdout };