From 5e0007798bcbccd1f52a5dd9d4154f0af1c1f427 Mon Sep 17 00:00:00 2001 From: s0ph1e Date: Fri, 7 Dec 2018 21:43:30 +0200 Subject: [PATCH 1/2] Fix test for win --- test/unit/scraper-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/scraper-test.js b/test/unit/scraper-test.js index be974b04..e4bbcc18 100644 --- a/test/unit/scraper-test.js +++ b/test/unit/scraper-test.js @@ -83,7 +83,7 @@ describe('Scraper', function () { var r = new Resource('http://example.com/a.png', 'a.png'); r.setText('some text'); - return s.saveResource(r).finally(function() { + return s.saveResource(r).then(() => should(true).eql(false)).catch(function() { s.handleError.calledOnce.should.be.eql(true); s.handleError.calledWith(dummyError).should.be.eql(true); }); @@ -217,7 +217,7 @@ describe('Scraper', function () { var r = new Resource('http://example.com/a.png'); - return s.requestResource(r).finally(function() { + return s.requestResource(r).then(() => should(true).eql(false)).catch(function() { s.handleError.calledOnce.should.be.eql(true); }); }); From bb6ade9d99eff57b5ddce7b984ca9602a50895cf Mon Sep 17 00:00:00 2001 From: s0ph1e Date: Fri, 7 Dec 2018 21:50:37 +0200 Subject: [PATCH 2/2] Fix eslint --- lib/scraper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scraper.js b/lib/scraper.js index b8cd8980..41c78acc 100644 --- a/lib/scraper.js +++ b/lib/scraper.js @@ -137,7 +137,7 @@ class Scraper { this.runActions('onResourceSaved', {resource}); } catch (err) { logger.warn('failed to save resource ' + resource); - return this.handleError(err, resource); + await this.handleError(err, resource); } }