nodejs-mozilla/test/parallel/test-console-log-throw-prim...

15 lines
315 B
JavaScript
Raw Normal View History

2022-07-18 11:52:00 +08:00
'use strict';
require('../common');
const { Writable } = require('stream');
const { Console } = require('console');
const stream = new Writable({
write() {
throw null; // eslint-disable-line no-throw-literal
}
});
const console = new Console({ stdout: stream });
console.log('test'); // Should not throw