blob: 5a4f511ee97bbb21d9e7c66d9e2287c026060163 [file] [log] [blame]
'use strict';
// Test that monkeypatching console._stdout and console._stderr works.
const common = require('../common');
const { Writable } = require('stream');
const streamToNowhere = new Writable({ write: common.mustCall() });
const anotherStreamToNowhere = new Writable({ write: common.mustCall() });
// Overriding the lazy-loaded _stdout and _stderr properties this way is what we
// are testing. Don't change this to be a Console instance from calling a
// constructor. It has to be the global `console` object.
console._stdout = streamToNowhere;
console._stderr = anotherStreamToNowhere;
console.log('fhqwhgads');
console.error('fhqwhgads');