Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen-cronic committed Jul 24, 2024
1 parent 42fead4 commit a090a92
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/arguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ test('throws if the url option is missing', async t => {
});
});

test('throws if an invalid argument is passed', async t => {
await t.throwsAsync(
// @ts-expect-error Error tests
got(false),
{
instanceOf: RequestError,
message: 'Expected values which are `string`, `URL`, `Object`, or `undefined`. Received values of type `boolean`.',
});
});

test('throws an error if the protocol is not specified', async t => {
const error = await t.throwsAsync(got('example.com'));
invalidUrl(t, error!, 'example.com');
Expand Down

0 comments on commit a090a92

Please sign in to comment.