mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-16 21:11:22 +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",
|
||||
"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
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