Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create README.

  • Loading branch information...
commit bf6f9fbf14b1a01a0c34fd7ea4e24dbd5c35e7e1 1 parent fd10acb
David Braun authored
Showing with 37 additions and 0 deletions.
  1. +37 −0 README.md
View
37 README.md
@@ -0,0 +1,37 @@
+Extends [Node.js's assert](http://nodejs.org/api/assert.html) with two new tests
+for events:
+
+```JavaScript
+var assert = require('assert2'),
+ events = require('events'),
+ emitter = new events.EventEmitter();
+
+assert.emits(emitter, 'event', function () {
+ emitter.emit('event');
+});
+
+assert.doesNotEmit(emitter, 'event', function () {
+ // zero-emissions code
+});
+```
+
+[SemVer](http://semver.org/) compliant
+
+# API
+
+All of Node's assert tests, plus:
+
+## assert.emits(emitter, event, block, [message])
+
+Expects `emitter` to emit `event` while executing `block`. If untrue, throws
+an exception with a default message which you may override with `message`.
+
+## assert.doesNotEmit(emitter, event, block, [message])
+
+Expects `emitter` not to emit `event` while executing `block`. If untrue,
+throws an exception with a default message which you may override with
+`message`.
+
+# License
+
+MIT
Please sign in to comment.
Something went wrong with that request. Please try again.