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.

13 lines
344 B

4 years ago
  1. 'use strict';
  2. var assert = require('assert');
  3. var EventEmitter = require('../');
  4. var EE = new EventEmitter();
  5. assert.throws(function () {
  6. EE.emit('error', 'Accepts a string');
  7. }, 'Error: Unhandled error. (Accepts a string)');
  8. assert.throws(function () {
  9. EE.emit('error', { message: 'Error!' });
  10. }, 'Unhandled error. ([object Object])');