Skip to content

Commit

Permalink
better checking for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha committed Jun 19, 2022
1 parent b9be8f3 commit 1a3f624
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions integration-tests/tests/api/schema/publish.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,13 +994,14 @@ test('CDN data can not be fetched with an invalid access token', async () => {

const cdn = cdnAccessResult.body.data!.createCdnToken;

const cdnResult = await axios.get<{ sdl: string }>(`${cdn.url}/schema`, {
headers: {
'X-Hive-CDN-Key': 'i-like-turtles',
},
responseType: 'json',
});
expect(cdnResult.status).toEqual(403);
await expect(() =>
axios.get<{ sdl: string }>(`${cdn.url}/schema`, {
headers: {
'X-Hive-CDN-Key': 'i-like-turtles',
},
responseType: 'json',
})
).rejects.toThrow(/403/);
});

test('CDN data can be fetched with an valid access token', async () => {
Expand Down

0 comments on commit 1a3f624

Please sign in to comment.