Skip to content

Commit

Permalink
change response type so we can still process different type of files
Browse files Browse the repository at this point in the history
  • Loading branch information
deniak committed Dec 11, 2024
1 parent fc1b2ce commit 632e253
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/document-downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ DocumentDownloader.fetch = url =>
sua
.get(url)
.set('User-Agent', 'W3C/Echidna')
.responseType('blob')
.end((err, res) => {
if (err) {
reject(
Expand Down
5 changes: 2 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit 632e253

Please sign in to comment.