mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
e5ad5456a2
PR-URL: https://github.com/nodejs/node/pull/15623 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
24 lines
485 B
JavaScript
24 lines
485 B
JavaScript
'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])'
|
|
}
|
|
);
|