diff --git a/package.json b/package.json index 28d63a0..f9afa8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "routeros-client", - "version": "0.2.6", + "version": "0.2.7", "description": "Easy to use abstraction layer over the node-routeros API", "main": "./dist/index", "types": "./dist/index", @@ -38,7 +38,7 @@ }, "homepage": "https://github.com/aluisiora/routeros-client#readme", "devDependencies": { - "@types/chai": "^4.0.6", + "@types/chai": "^4.0.8", "@types/debug": "0.0.30", "@types/mocha": "^2.2.44", "@types/node": "^6.0.92", @@ -51,6 +51,6 @@ }, "dependencies": { "debug": "^3.1.0", - "node-routeros": "^1.0.9" + "node-routeros": "^1.1.2" } } diff --git a/src/RosApiCrud.ts b/src/RosApiCrud.ts index 28e2c5c..b969733 100644 --- a/src/RosApiCrud.ts +++ b/src/RosApiCrud.ts @@ -234,7 +234,11 @@ export abstract class RouterOSAPICrud { break; } - if (tmpVal === null) tmpVal = ""; + if (typeof tmpVal === "boolean") { + tmpVal = tmpVal ? "yes" : "no"; + } else if (tmpVal === null) { + tmpVal = ""; + } tmpKey = (addQuestionMark ? "?" : "=") + tmpKey; diff --git a/test/connection.spec.js b/test/1.connection.spec.js similarity index 89% rename from test/connection.spec.js rename to test/1.connection.spec.js index 74e513d..a76707e 100644 --- a/test/connection.spec.js +++ b/test/1.connection.spec.js @@ -25,11 +25,14 @@ describe("RouterOSClient", () => { }); }); - it("should not connect with invalid username and password", (done) => { + it("should not connect with invalid username and password", function(done) { + this.timeout(7000); + const conn = new RouterOSClient({ host: address, user: "admin1", - password: "admin1" + password: "admin1", + timeout: 5 }); conn.connect().then((api) => { diff --git a/test/printing.spec.js b/test/2.printing.spec.js similarity index 100% rename from test/printing.spec.js rename to test/2.printing.spec.js diff --git a/test/writing.spec.js b/test/3.writing.spec.js similarity index 100% rename from test/writing.spec.js rename to test/3.writing.spec.js diff --git a/test/streaming.spec.js b/test/4.streaming.spec.js similarity index 100% rename from test/streaming.spec.js rename to test/4.streaming.spec.js