unexpected-eventemitter
    Overview
    Documentation
    Tutorials
    Insights
    Code
    Dependencies
    Contributors
    Jobs

unexpected-eventemitter

EventEmitter assertions for Unexpected

1.1.3  •  Updated 1 years ago  •  by Christopher Hiller  •  Apache License 2.0

EventEmitter assertions for Unexpected

Installation

$ npm i unexpected unexpected-eventemitter --save-dev
  • This module requires Node.js v6+, IE11, or a modern browser.
  • unexpected is a peer dependency of this module.
  • In a browser, this module is exposed as global.unexpectedEventEmitter.

Example

const unexpected = require('unexpected');
const {EventEmitter} = require('events');

const expect = unexpected.clone().use(require('unexpected-eventemitter'));

const ee = new EventEmitter();
expect(() => ee.emit('foo', {bar: 'baz'}), 'to emit from', ee, 'foo', {
  bar: 'baz'
});

Assertions

to emit from

<function> [not] to emit from <EventEmitter> <string> <any*>

  • EventEmitter may be a duck-typed Node.js EventEmitter.
  • <any*> corresponds to zero (0) or more values which may be emitted.
  • An EventEmitter emitting more values than expected will not fail an assertion.
  • Values are checked with “to satisfy” for flexibility.

Contributing

Please use the Angular commit message format.

License

©️ 2017 Christopher Hiller. Licensed Apache-2.0.

Popularity

Weekly Downloads
242
Stars
1

Maintenance

Development

Last ver 1 year ago
Created 3 years ago
Last commit 1 year ago
1 month between commits

Technology

Node version: 10.15.1
11.8K unpacked

Compliance

Apache License 2.0
OSI Approved
0 vulnerabilities

Contributors

2 contributors
Christopher Hiller
Maintainer, 24 commits, 1 merges
Works at IBM
Andreas Lind
1 commits, 1 PRs
Works at peakon
dependabot
3 PRs

Tags

unexpected
assertion
assert
event
events
eventemitter
ee
test
tdd
bdd
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.