mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-05 11:10:44 +00:00
Added tests
This commit is contained in:
parent
29f02d187f
commit
b2191cdfc1
2 changed files with 23 additions and 1 deletions
|
|
@ -7,6 +7,9 @@
|
||||||
"name": "roblabla",
|
"name": "roblabla",
|
||||||
"email": "robinlambertz.dev@gmail.com"
|
"email": "robinlambertz.dev@gmail.com"
|
||||||
},
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "mocha --reporter spec"
|
||||||
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"licenses": {
|
"licenses": {
|
||||||
"type": "MIT"
|
"type": "MIT"
|
||||||
|
|
@ -14,7 +17,8 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minecraft-protocol": "^0.14.0",
|
"minecraft-protocol": "^0.14.0",
|
||||||
"buffers": "0.1.1",
|
"buffers": "0.1.1",
|
||||||
"longjohn": "~0.2.8"
|
"mocha": "~2.2.5",
|
||||||
|
"chai": "~3.2.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
@ -22,5 +26,8 @@
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "http://github.com/mhsjlw/node-minecraft-server/issues"
|
"url": "http://github.com/mhsjlw/node-minecraft-server/issues"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"longjohn": "~0.2.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
15
tests/index.js
Normal file
15
tests/index.js
Normal 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);
|
||||||
|
})
|
||||||
|
});
|
||||||
Loading…
Reference in a new issue