commit d970bd118f724842ba458d081bc493bd33dc56bd
parent 9e5f3294729a6fa618880374ad259de0d7a6bffe
Author: MTRNord <mtrnord1@gmail.com>
Date: Thu, 17 Mar 2016 21:02:24 +0100
Add some basics and placeholder tests
Diffstat:
5 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
@@ -1,3 +0,0 @@
-nBot
-=
-A clone of the eBot by deStrO fully based on node.js with build in Web Page
diff --git a/package.json b/package.json
@@ -4,7 +4,7 @@
"description": "A clone of the eBot by deStrO fully based on node.js with build in Web Page",
"main": "start.js",
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "test": "./node_modules/.bin/mocha --reporter tests"
},
"repository": {
"type": "git",
@@ -24,5 +24,10 @@
"bugs": {
"url": "https://github.com/MTRNord/nBot/issues"
},
- "homepage": "https://github.com/MTRNord/nBot#readme"
+ "homepage": "https://github.com/MTRNord/nBot#readme",
+ "dependencies": {
+ "chai": "^3.5.0",
+ "mocha": "^2.4.5",
+ "srcds-rcon": "^2.2.0"
+ }
}
diff --git a/start.js b/start.js
@@ -0,0 +1,21 @@
+let rcon = require('srcds-rcon')({
+ address: 'IP',
+ password: 'test'
+});
+
+rcon.connect().then(() => {
+ return rcon.command('sv_airaccelerate 10').then(() => {
+ console.log('changed sv_airaccelerate');
+ });
+}).then(
+ () => rcon.command('status').then(status => console.log(`got status ${status}`))
+).then(
+ () => rcon.command('cvarlist').then(cvarlist => console.log(`cvarlist is \n${cvarlist}`))
+).then(
+ () => rcon.command('changelevel de_dust2').then(() => console.log('changed map'))
+).then(
+ () => rcon.disconnect()
+).catch(err => {
+ console.log('caught', err);
+ console.log(err.stack);
+});
diff --git a/tests/start.js b/tests/start.js
@@ -0,0 +1,7 @@
+describe("Placeholder", function() {
+ it("keeps place", function() {
+ var placeholderVar = 1;
+
+ expect(placeholderVar).to.equal(1);
+ });
+});
diff --git a/start.js b/web/index.html