diff --git a/superagent/superagent-tests.ts b/superagent/superagent-tests.ts index 23961b30ab..5779f81e90 100644 --- a/superagent/superagent-tests.ts +++ b/superagent/superagent-tests.ts @@ -9,4 +9,5 @@ agent .end((err, res) => { if (err) throw err; if (res.status !== 200) throw new Error('bad status ' + res.status); + if (res.body.foo === 'bar') throw new Error('bad body'); }); diff --git a/superagent/superagent.d.ts b/superagent/superagent.d.ts index ee2aaa5f48..9ff52099ce 100644 --- a/superagent/superagent.d.ts +++ b/superagent/superagent.d.ts @@ -8,8 +8,9 @@ declare module "superagent" { export interface Response { text: string; - body: Object; - header: Object; + body: any; + files: any; + header: any; type: string; charset: string; status: number;