Skip to content

Commit

Permalink
Add failing test for #897
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 1, 2019
1 parent fc384a4 commit cb042ac
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,20 @@ test('throws when form body is not a plain object or array', async t => {
message: 'The `form` option must be an Object'
});
});

// See https://github.com/sindresorhus/got/issues/897
test.failing('the `json` payload is not touched', withServer, async (t, server, got) => {
server.post('/', defaultEndpoint);

const {body} = await got.post({
json: {
context: {
foo: true
}
},
responseType: 'json'
});

t.true('context' in body);
t.true(body.context.foo);
});

0 comments on commit cb042ac

Please sign in to comment.