Add extra checks to channel.js for deadness
This commit is contained in:
parent
d5c5de41e1
commit
39fe452e96
3 changed files with 116 additions and 8 deletions
34
tests/channelDeadRace.js
Normal file
34
tests/channelDeadRace.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
var io = require('socket.io-client');
|
||||
|
||||
function testLogin() {
|
||||
var socket = io.connect('http://localhost:1337');
|
||||
socket.on('connect', function () {
|
||||
socket.emit('login', { name: 'test', pw: 'test' });
|
||||
socket.emit('joinChannel', { name: 'test' });
|
||||
socket.disconnect();
|
||||
});
|
||||
}
|
||||
|
||||
function testBan() {
|
||||
var socket = io.connect('http://localhost:1337');
|
||||
socket.on('connect', function () {
|
||||
socket.emit('login', { name: 'test', pw: 'test' });
|
||||
socket.emit('joinChannel', { name: 'test' });
|
||||
socket.emit('chatMsg', { msg: '/ban asdf' });
|
||||
socket.disconnect();
|
||||
});
|
||||
}
|
||||
|
||||
function testRankChange() {
|
||||
var socket = io.connect('http://localhost:1337');
|
||||
socket.on('connect', function () {
|
||||
socket.emit('login', { name: 'test', pw: 'test' });
|
||||
socket.emit('joinChannel', { name: 'test' });
|
||||
socket.emit('setChannelRank', { user: 'test2', rank: 2 });
|
||||
socket.disconnect();
|
||||
});
|
||||
}
|
||||
|
||||
testLogin();
|
||||
testBan();
|
||||
testRankChange();
|
||||
Loading…
Add table
Add a link
Reference in a new issue