source: trip-planner-front/node_modules/events/tests/errors.js@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 344 bytes
Line 
1'use strict';
2var assert = require('assert');
3var EventEmitter = require('../');
4
5var EE = new EventEmitter();
6
7assert.throws(function () {
8 EE.emit('error', 'Accepts a string');
9}, 'Error: Unhandled error. (Accepts a string)');
10
11assert.throws(function () {
12 EE.emit('error', { message: 'Error!' });
13}, 'Unhandled error. ([object Object])');
Note: See TracBrowser for help on using the repository browser.