UNPKG

ks3

Version:

本代码库为`金山云存储KS3`服务.主要提供`KS3 nodejs SDK`和`命令行工具`.

28 lines (18 loc) 617 B
const EventDispatcer = require('../lib/common/event') describe('test eventDispatcher', function () { const eventBus = new EventDispatcer() it ('can be described', function (done) { eventBus.on('事件1', function (d) { done() }) eventBus.emit('事件1', 'hello world~') }) // TODO 未完待续 it('can be described once', function (done) { eventBus.once('一次性事件', function (d) { done() }) eventBus.emit('一次性事件', '第二次') eventBus.emit('一次性事件', '第一次') }) })