You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
396 B

'use strict';
require('../common');
const EventEmitter = require('events');
const assert = require('assert');
const EE = new EventEmitter();
assert.throws(() => {
EE.emit('error', 'Accepts a string');
}, /^Error: Unhandled "error" event\. \(Accepts a string\)$/);
assert.throws(() => {
EE.emit('error', {message: 'Error!'});
}, /^Error: Unhandled "error" event\. \(\[object Object\]\)$/);