From df2ec90daa7735517f009266772c72423b4b5895 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Mon, 9 Mar 2015 00:44:05 +0300 Subject: [PATCH] + test --- test/utils.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/utils.js diff --git a/test/utils.js b/test/utils.js new file mode 100644 index 00000000..438c5435 --- /dev/null +++ b/test/utils.js @@ -0,0 +1,25 @@ +/** + * Created by tmshv on 08/03/15. + */ + +var should = require("should"); + +describe("utils", function () { + describe("net.js", function () { + describe("query", function () { + var query = require("../utils/net").query; + var sample = [["count", 10], ["portion", 5], ["hello", "lol"]]; + + it("should combine query params", function () { + var params = query(sample); + params.should.be.equal("count=10&portion=5&hello=lol"); + }); + + it("should return string", function () { + var params = query(sample); + + params.should.be.type("string"); + }); + }); + }); +}); \ No newline at end of file