From 8e6d2044bf6710b203c8abba411bd5bf80645a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alu=C3=ADsio=20Amaral?= Date: Tue, 5 Dec 2017 09:55:19 -0200 Subject: [PATCH 1/3] ordered tests --- test/{connection.spec.js => 1.connection.spec.js} | 7 +++++-- test/{printing.spec.js => 2.printing.spec.js} | 0 test/{writing.spec.js => 3.writing.spec.js} | 0 test/{streaming.spec.js => 4.streaming.spec.js} | 0 4 files changed, 5 insertions(+), 2 deletions(-) rename test/{connection.spec.js => 1.connection.spec.js} (89%) rename test/{printing.spec.js => 2.printing.spec.js} (100%) rename test/{writing.spec.js => 3.writing.spec.js} (100%) rename test/{streaming.spec.js => 4.streaming.spec.js} (100%) 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 From 39c67d1c5b35eadd30754869e76d699aa5e8386a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alu=C3=ADsio=20Amaral?= Date: Tue, 5 Dec 2017 09:55:43 -0200 Subject: [PATCH 2/3] boolean vals are converted to "yes" or "no" --- package.json | 4 ++-- src/RosApiCrud.ts | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 28d63a0..6155231 100644 --- a/package.json +++ b/package.json @@ -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; From 2ff266f6673b10fee3b8c339a7fb61cab56c11cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alu=C3=ADsio=20Amaral?= Date: Tue, 5 Dec 2017 10:52:34 -0200 Subject: [PATCH 3/3] v0.2.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6155231..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",