Skip to content

Commit

Permalink
Fixed coverage with extra test
Browse files Browse the repository at this point in the history
  • Loading branch information
pietercolpaert committed Mar 14, 2024
1 parent be8fdc9 commit 490f55e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/JsonLdParser-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ describe('JsonLdParser', () => {
ERROR_CODES.LOADING_DOCUMENT_FAILED))
});

it('should error on an application/activity+json without link header if the wellknowntypes do not include it', () => {
expect(() => JsonLdParser.fromHttpResponse('BASE', 'application/activity+json', undefined, {
wellKnownContentTypes: []
})).toThrow(new ErrorCoded(`Missing context link header for media type application/activity+json on BASE`,
ERROR_CODES.LOADING_DOCUMENT_FAILED))
});

it('should error on a plain JSON response without link header', () => {
expect(() => JsonLdParser.fromHttpResponse('BASE', 'application/json'))
.toThrow(new ErrorCoded(`Missing context link header for media type application/json on BASE`,
Expand Down

0 comments on commit 490f55e

Please sign in to comment.