Skip to content

Commit

Permalink
Test request.method
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed Jul 6, 2020
1 parent b784ace commit ae29c0a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ test('accepts `string` as the input parameter', wrapper, async (t, server) => {
t.is(data, 'ok');
});

test('`method` property', wrapper, async (t, server) => {
const request = makeRequest(server.url);
t.is(request.method, 'GET');

request.method = 'post';
t.is(request.method, 'POST');

request.method = 0;
t.is(request.method, 'POST');

request.abort();
});

test('accepts `options` as the input parameter', wrapper, async (t, server) => {
server.get('/200', okHandler);

Expand Down

0 comments on commit ae29c0a

Please # to comment.