From f42f75e8e64795ba5ed304673b7c6a14e0598521 Mon Sep 17 00:00:00 2001 From: Mat Carey Date: Mon, 22 Feb 2016 14:47:39 +0000 Subject: [PATCH 1/3] fixed tests on master. --- .eslintrc | 3 --- test/general.js | 14 +++++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.eslintrc b/.eslintrc index 7dcf6f3..8bcd32d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -37,9 +37,6 @@ "no-mixed-requires": 2, "no-process-exit": 0, "handle-callback-err": [2, "^(e|err|error)$"], - - "generator-star": [2, "end"], - "indent": [2, 2], "brace-style": [2, "1tbs", {"allowSingleLine": true}], "comma-style": 2, diff --git a/test/general.js b/test/general.js index effcd91..b36bf54 100644 --- a/test/general.js +++ b/test/general.js @@ -73,10 +73,10 @@ fastimage.info("http://placehold.it/200x100", function(error, info){ verify(done, function(){ expect(error).not.to.be.ok(); - expect(info).to.only.have.keys(["width", "height", "type", "url", "transferred", "time"]); + expect(info).to.only.have.keys(["width", "height", "type", "url", "transferred", "time", "realUrl", "size"]); expect(info.width).to.equal(200); expect(info.height).to.equal(100); - expect(info.type).to.equal("gif"); + expect(info.type).to.equal("png"); expect(info.url).to.equal("http://placehold.it/200x100"); expect(info.transferred).to.be.a("number"); expect(info.time).to.be.a("number"); @@ -119,7 +119,7 @@ }); it("should return a error when the URL is not a image", function(done){ - fastimage.info("http://placehold.it", function(error, info){ + fastimage.info("http://example.com/", function(error, info){ verify(done, function(){ expect(info).not.to.be.ok(); expect(error).to.be.a(fastimage.FastImageError); @@ -130,14 +130,14 @@ }); }); - it("should return a error when the URL is not a image", function(done){ + it("should return a error when the URL is a text file", function(done){ fastimage.info("http://placehold.it/robots.txt", function(error, info){ verify(done, function(){ expect(info).not.to.be.ok(); expect(error).to.be.a(fastimage.FastImageError); - expect(error.code).to.equal("UNSUPPORTED_TYPE"); - expect(error.message).to.equal("Unsupported image file."); + expect(error.code).to.equal("SERVER_ERROR"); + expect(error.message).to.equal("Unexpected response from the remote host."); }); }); }); @@ -355,7 +355,7 @@ it("should return the type of a image", function(done){ fastimage.type("http://placehold.it/200x100", function(error, info){ verify(done, function(){ - expect(info).to.equal("gif"); + expect(info).to.equal("png"); }); }); }); From 0dfe6f0c7dce332f267d91c99e1178748fbbe409 Mon Sep 17 00:00:00 2001 From: Mat Carey Date: Mon, 22 Feb 2016 14:49:45 +0000 Subject: [PATCH 2/3] Declaring node version. --- .nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..7aefc82 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v5.6.0 From c1c76e7b26e9e8fe472e8998eecab53762862b6d Mon Sep 17 00:00:00 2001 From: Mat Carey Date: Tue, 23 Feb 2016 12:51:03 +0000 Subject: [PATCH 3/3] Brought back original test expectation - previous attempt lowered code coverage which is bad. --- test/general.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/general.js b/test/general.js index b36bf54..10b6f16 100644 --- a/test/general.js +++ b/test/general.js @@ -131,13 +131,13 @@ }); it("should return a error when the URL is a text file", function(done){ - fastimage.info("http://placehold.it/robots.txt", function(error, info){ + fastimage.info("https://placeholdit.imgix.net/~text?txtsize=28&bg=0099ff&txt=300%C3%97300&w=300&h=300&fm=tif", function(error, info){ verify(done, function(){ expect(info).not.to.be.ok(); expect(error).to.be.a(fastimage.FastImageError); - expect(error.code).to.equal("SERVER_ERROR"); - expect(error.message).to.equal("Unexpected response from the remote host."); + expect(error.code).to.equal("UNSUPPORTED_TYPE"); + expect(error.message).to.equal("Unsupported image file."); }); }); });