Added tests

This commit is contained in:
mhsjlw 2015-08-24 10:25:34 -04:00
parent 29f02d187f
commit b2191cdfc1
2 changed files with 23 additions and 1 deletions

View file

@ -7,6 +7,9 @@
"name": "roblabla",
"email": "robinlambertz.dev@gmail.com"
},
"scripts": {
"test": "mocha --reporter spec"
},
"keywords": [],
"licenses": {
"type": "MIT"
@ -14,7 +17,8 @@
"dependencies": {
"minecraft-protocol": "^0.14.0",
"buffers": "0.1.1",
"longjohn": "~0.2.8"
"mocha": "~2.2.5",
"chai": "~3.2.0"
},
"repository": {
"type": "git",
@ -22,5 +26,8 @@
},
"bugs": {
"url": "http://github.com/mhsjlw/node-minecraft-server/issues"
},
"devDependencies": {
"longjohn": "~0.2.8"
}
}

15
tests/index.js Normal file
View file

@ -0,0 +1,15 @@
var boot = require('../app').boot,
shutdown = require('../app').shutdown,
port = require('../app').port,
describe("Server", function() {
if("Is running", function(done) {
var client = net.Socket();
client.connect(25565, '127.0.0.1', function() {
client.close(); // or whatever the method to close the socket;
done();
});
client.on('error', function(err) {
done(err);
})
});