-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
37 lines (29 loc) · 888 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*!
* dush-no-chaining <https://github.com/tunnckoCore/dush-no-chaining>
*
* Copyright (c) Charlike Mike Reagent <@tunnckoCore> (https://i.am.charlike.online)
* Released under the MIT license.
*/
/* jshint asi:true */
'use strict'
var test = require('mukla')
var dush = require('dush')
var noChaining = require('./index')
var noop = function noop () {}
var app = dush().use(noChaining())
test('should `.on` and `.once` return undefined', function (done) {
var ret1 = app.on('foo', noop)
var ret2 = app.once('foo', noop)
test.strictEqual(ret1, undefined)
test.strictEqual(ret2, undefined)
done()
})
test('should `.off` return undefined', function (done) {
test.strictEqual(app.off('foo', noop), undefined)
done()
})
test('should `.emit` return undefined', function (done) {
var emitter = app.emit('foo', 123)
test.strictEqual(emitter, undefined)
done()
})