mirror of https://github.com/lukechilds/node.git
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.
23 lines
485 B
23 lines
485 B
'use strict';
|
|
const common = require('../common');
|
|
const EventEmitter = require('events');
|
|
|
|
const EE = new EventEmitter();
|
|
|
|
common.expectsError(
|
|
() => EE.emit('error', 'Accepts a string'),
|
|
{
|
|
code: 'ERR_UNHANDLED_ERROR',
|
|
type: Error,
|
|
message: 'Unhandled error. (Accepts a string)'
|
|
}
|
|
);
|
|
|
|
common.expectsError(
|
|
() => EE.emit('error', { message: 'Error!' }),
|
|
{
|
|
code: 'ERR_UNHANDLED_ERROR',
|
|
type: Error,
|
|
message: 'Unhandled error. ([object Object])'
|
|
}
|
|
);
|
|
|