stream-server.js
1.15 KB
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
38
39
40
41
42
43
44
45
46
47
'use strict';
var test = require('tape');
var sinon = require('sinon');
var tinyJsonRpc = require('../');
var Server = tinyJsonRpc.Server;
var StreamServer = tinyJsonRpc.StreamServer;
test('StreamServer instances', function (t) {
t.test('are instances of Server', function (t) {
t.ok(new StreamServer() instanceof Server);
t.end();
});
t.test('inherit a respond method', function (t) {
var server = new StreamServer();
t.equal(server.respond, Server.prototype.respond);
t.end();
});
t.test('inherit a provide method', function (t) {
var server = new StreamServer();
t.equal(server.provide, Server.prototype.provide);
t.end();
});
t.test('inherit a revoke method', function (t) {
var server = new StreamServer();
t.equal(server.revoke, Server.prototype.revoke);
t.end();
});
t.test('inherit a provides method', function (t) {
var server = new StreamServer();
t.equal(server.provides, Server.prototype.provides);
t.end();
});
t.test('provide a listen method', function (t) {
var server = new StreamServer();
t.equal(typeof server.listen, 'function');
t.end();
});
t.end();
});