1 |
|
2 |
|
3 |
|
4 |
|
5 | 'use strict'
|
6 |
|
7 | const eventSource = require('../lib/events/event_source.js')
|
8 | const assert = require('assert')
|
9 | const co = require('co')
|
10 |
|
11 | describe('event-source', function () {
|
12 | this.timeout(3000)
|
13 |
|
14 | before(() => co(function * () {
|
15 |
|
16 | }))
|
17 |
|
18 | after(() => co(function * () {
|
19 |
|
20 | }))
|
21 |
|
22 | it('Event source', () => co(function * () {
|
23 | let instance = eventSource('http://example.com', {
|
24 | foo () {
|
25 |
|
26 | }
|
27 | })
|
28 | assert.ok(instance)
|
29 | assert.ok(instance._events.foo)
|
30 | }))
|
31 | })
|
32 |
|
33 |
|