forked from simplewebrtc/signalmaster
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.js
More file actions
31 lines (24 loc) · 736 Bytes
/
test.js
File metadata and controls
31 lines (24 loc) · 736 Bytes
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
var tape = require('tape');
var config = require('getconfig');
var server = require('./server');
var test = tape.createHarness();
var output = test.createStream();
output.pipe(process.stdout);
output.on('end', function () {
console.log('Tests complete, killing server.');
process.exit(0);
});
var io = require('socket.io-client');
var socketURL = 'http://localhost:' + config.server.port;
var socketOptions = {
transports: ['websocket'],
'force new connection': true
};
test('it should not crash when sent an empty message', function (t) {
t.plan(1);
var client = io.connect(socketURL, socketOptions);
client.on('connect', function () {
client.emit('message');
t.ok(true);
});
});