From 4c8ebd4d4ce3e552e5561988b979e332ce3c6783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominykas=20Blyz=CC=8Ce=CC=87?= Date: Sun, 8 Nov 2015 19:31:27 +0200 Subject: [PATCH] fixing failing tests; updating deps to latest --- .travis.yml | 8 ++++++ package.json | 6 ++--- test/multi-glob-test.js | 54 ++++++++++++++++++++++------------------- 3 files changed, 40 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 587bd3e..896e270 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1,9 @@ language: node_js +sudo: false +node_js: + - "0.10" + - "0.12" + - "4" + - "5" +before_install: + - npm i -g npm diff --git a/package.json b/package.json index 61f54a5..1f6f6ef 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,9 @@ "test-debug": "node --debug-brk node_modules/buster/bin/buster-test" }, "dependencies": { - "glob": ">=3.1.9", - "async": ">=0.1.22", - "lodash": "~1.0" + "glob": "5.x", + "async": "1.x", + "lodash": "3.x" }, "devDependencies": { "buster": "*" diff --git a/test/multi-glob-test.js b/test/multi-glob-test.js index 5a0f08c..a91f720 100644 --- a/test/multi-glob-test.js +++ b/test/multi-glob-test.js @@ -57,58 +57,62 @@ buster.testCase("Multi-glob", { assert.calledWith(glob.glob, "src/buster.js"); }, - "calls callback with result from glob": function () { + "calls callback with result from glob": function (done) { var callback = this.spy(); glob.glob.yields(null, ["lib/buster.js"]); - g.glob("lib/buster.js", callback); - - assert.calledOnceWith(callback, undefined, ["lib/buster.js"]); + g.glob("lib/buster.js", function (err, res) { + assert.isNull(err); + assert.equals(res, ["lib/buster.js"]); + done(); + }); }, - "calls callback with combined results from glob": function () { - var callback = this.spy(); + "calls callback with combined results from glob": function (done) { glob.glob.withArgs("lib/buster.js").yields(null, ["lib/buster.js"]); var files = ["src/buster.js", "src/stuff.js"]; glob.glob.withArgs("src/*.js").yields(null, files); - g.glob(["lib/buster.js", "src/*.js"], callback); - - assert.calledWith(callback, undefined, - ["lib/buster.js", "src/buster.js", "src/stuff.js"]); + g.glob(["lib/buster.js", "src/*.js"], function (err, res) { + assert.isNull(err); + assert.equals(res, ["lib/buster.js", "src/buster.js", "src/stuff.js"]); + done(); + }); }, - "calls callback once with glob error": function () { - var callback = this.spy(); + "calls callback once with glob error": function (done) { glob.glob.withArgs("lib/buster.js").yields({ message: "Oh no" }); var files = ["src/buster.js", "src/stuff.js"]; glob.glob.withArgs("src/*.js").yields(null, files); - g.glob(["lib/buster.js", "src/*.js"], callback); - - assert.calledWith(callback, { message: "Oh no" }); + g.glob(["lib/buster.js", "src/*.js"], function (err) { + assert.equals(err, { message: "Oh no" }); + done(); + }); }, - "ignore duplicated items from glob": function () { - var callback = this.spy(); + "ignore duplicated items from glob": function (done) { glob.glob.withArgs("src/foo.js").yields(null, ["src/foo.js"]); var files = ["src/foo.js", "src/bar.js"]; glob.glob.withArgs("src/*.js").yields(null, files); - g.glob(["src/foo.js", "src/*.js"], callback); - - assert.calledWith(callback, undefined, ["src/foo.js", "src/bar.js"]); + g.glob(["src/foo.js", "src/*.js"], function (err, res) { + assert.isNull(err); + assert.equals(res, ["src/foo.js", "src/bar.js"]); + done(); + }); }, "strict": { - "fails on glob that matches no patterns": function () { + "fails on glob that matches no patterns": function (done) { var callback = this.spy(); glob.glob.withArgs("src/foo.js").yields(null, []); - g.glob(["src/foo.js"], { strict: true }, callback); - - assert.match(callback.args[0][0], { - message: "'src/foo.js' matched no files" + g.glob(["src/foo.js"], { strict: true }, function (err) { + assert.match(err, { + message: "'src/foo.js' matched no files" + }); + done() }); } }