-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #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>
- Loading branch information
Showing
9 changed files
with
110 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
'use strict'; | ||
require('../common'); | ||
const common = 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\)$/); | ||
common.expectsError( | ||
() => EE.emit('error', 'Accepts a string'), | ||
{ | ||
code: 'ERR_UNHANDLED_ERROR', | ||
type: Error, | ||
message: 'Unhandled error. (Accepts a string)' | ||
} | ||
); | ||
|
||
assert.throws(() => { | ||
EE.emit('error', { message: 'Error!' }); | ||
}, /^Error: Unhandled "error" event\. \(\[object Object\]\)$/); | ||
common.expectsError( | ||
() => EE.emit('error', { message: 'Error!' }), | ||
{ | ||
code: 'ERR_UNHANDLED_ERROR', | ||
type: Error, | ||
message: 'Unhandled error. ([object Object])' | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters