Skip to content

Commit

Permalink
test: POST /requests - bad API key
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Mar 27, 2023
1 parent dc6baa2 commit 4541ad4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/integration/new-request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,22 @@ describe('Test Testing Farm POST /requests', () => {
test.todo('response', async () => {
const api = new TestingFarmAPI('https://api.dev.testing-farm.io/v0.1');

// const response = await api.newRequest( ... );
// const response = await api.newRequest({
// api_key: 'api_key',
// test: {},
// });
// expect(response).toBeDefined();
});

test('bad API key', async () => {
const api = new TestingFarmAPI('https://api.dev.testing-farm.io/v0.1');

const response = api.newRequest({
api_key: 'api_key',
test: {},
});
await expect(response).rejects.toThrowErrorMatchingInlineSnapshot(
'"{\\"errors\\":{\\"test\\":\\"Only one of test type \'fmf\', \'script\' or \'sti\' can be specified in \'test\' field.\\"}}"'
);
});
});

0 comments on commit 4541ad4

Please sign in to comment.