title: TypeScript doesn't recognize an object in Request response from supertest?
body: <p>I'm writing a test for a <em>very</em> simple graphql API in TypeScript using Supertest. I'm getting this error: <code>Property 'data' does not exist on type 'Response'</code>, and why should it? I haven't told it what to expect there. But how can I? <strong>data</strong> is immediately followed by <strong>should</strong>.</p>
  
  <p><a href="https://i.stack.imgur.com/YrSNG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YrSNG.png" alt="enter image description here"></a></p>
  
  <p>Here is my short test file.</p>
  
  <pre><code>import chai from "chai";
  import { expect } from "chai";
  import * as request from "supertest";
  import app from "../src";
  
  describe("graphQl test", () =&gt; {
  
      it("should respond with hello world", async (done) =&gt; {
  
          const returned = await request(app)
              .post("/graphql")
              .send({ query: "{ hello }"})
              .expect(200)
              .end((err, res) =&gt; {
                  if (err) { return done(err); }
                  res.data.should.have.property("hello");
                  done();
              });
  
          expect(returned.data.hello).equal("Hello world!");
      });
  });
  </code></pre>
  
  <p>Is there a simple solution to this? If not, I'm imagining I have to create some kind of interface, but how would I create an interface and communicate that interface to TypeScript in this scenario? I'm searching but I have yet to see an example of this.</p>