Skip to content

Commit

Permalink
Make sure sindresorhus#1118 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed Apr 1, 2020
1 parent d64298c commit a8c18bb
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion test/arguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test('string url with searchParams is preserved', withServer, async (t, server,

const path = '?test=http://example.com?foo=bar';
const {body} = await got(path);
t.is(body, `/${path}`);
t.is(body, '/?test=http%3A%2F%2Fexample.com%3Ffoo%3Dbar');
});

test('options are optional', withServer, async (t, server, got) => {
Expand Down Expand Up @@ -463,3 +463,22 @@ test('normalizes search params included in input', t => {

t.is(url.search, '?a=b+c');
});

test('reuse options while using init hook', withServer, async (t, server, got) => {
t.plan(2);

server.get('/', echoUrl);

const options = {
hooks: {
init: [
() => {
t.pass();
}
]
}
};

await got('', options);
await got('', options);
});

0 comments on commit a8c18bb

Please sign in to comment.