diff --git a/lib/document-downloader.js b/lib/document-downloader.js index 6d692640..5f121919 100644 --- a/lib/document-downloader.js +++ b/lib/document-downloader.js @@ -27,6 +27,7 @@ DocumentDownloader.fetch = url => sua .get(url) .set('User-Agent', 'W3C/Echidna') + .responseType('blob') .end((err, res) => { if (err) { reject( diff --git a/test/test.js b/test/test.js index 82fe3599..7e9817b0 100644 --- a/test/test.js +++ b/test/test.js @@ -79,8 +79,7 @@ describe('DocumentDownloader', () => { const notFound = DocumentDownloader.fetch( `${server.location()}/et/si/tu/n/existais/pas`, ); - - return expect(notFound).to.eventually.be.rejectedWith(/code 404/); + return expect(notFound).to.eventually.be.rejectedWith(/Not Found/); }); it('should reject if the server is not reachable', () => { @@ -241,7 +240,7 @@ describe('DocumentDownloader', () => { '/tmp/whatever', ); - return expect(notFound).to.eventually.be.rejectedWith(/code 404/); + return expect(notFound).to.eventually.be.rejectedWith(/Not Found/); }); it('should reject if the server is not reachable', () => {