Skip to content

Commit

Permalink
adding fail case for congress.gov
Browse files Browse the repository at this point in the history
  • Loading branch information
jshemas committed Oct 22, 2023
1 parent 0d2c60c commit 95d506e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/integration/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ describe('basic', function () {
expect(response).to.be.an('Response');
});
});
// this test works locally but fails during the github CI
it('congress.gov - should return og data', function () {
return ogs({ url: 'https://www.congress.gov/bill/117th-congress/house-bill/2617/text' })
.then(function ({ error, result, response }) {
Expand Down Expand Up @@ -375,6 +376,21 @@ describe('basic', function () {
'success',
);
expect(response).to.be.an('Response');
}).catch(function ({ error, result, response }) {
console.log('error:', error);
console.log('result:', result);
expect(error).to.be.eql(true);
expect(result.success).to.be.eql(false);
expect(result.requestUrl).to.be.eql('https://www.congress.gov/bill/117th-congress/house-bill/2617/text');
expect(result.error).to.eql('403 Forbidden');
expect(result.errorDetails?.toString()).to.eql('Error: 403 Forbidden');
expect(result).to.have.all.keys(
'error',
'errorDetails',
'requestUrl',
'success',
);
expect(response).to.eql(undefined);
});
});
});

0 comments on commit 95d506e

Please sign in to comment.