Chai response.body is always empty {} : <p>No matter what my server actually returns, Chai always gives me this exception when I assert response.body:</p>

<blockquote>
  <p>Uncaught AssertionError: expected {} to deeply equal 'test'</p>
</blockquote>

<p>Even though the actual server response is 'test', not {}:
<a href="https://i.stack.imgur.com/vbNGm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vbNGm.png" alt="enter image description here"></a></p>

<p>Here is my test:</p>

<pre><code>const chai = require('chai');
const chaiHttp = require('chai-http');
const server = require('./test-server');
const should = chai.should();    
chai.use(chaiHttp);

describe('GET /test', () =&gt; {
  it('it should give test result', (done) =&gt; {
    chai.request(server)
        .get('/test')
        .end((err, res) =&gt; {
            console.log(err); // outputs null
            console.log(res); // outputs normal-looking response
            res.body.should.be.eql('test');
            done();
        });
  });
});
</code></pre>

<p>Here is my server (test-server.js):</p>

<pre><code>const http = require('http');
const server = http.createServer(function (request, response) {
    response.writeHead(200, {"Content-Type": "text/plain"});
    response.end('test');
});

module.exports = server;

server.listen(process.env.PORT || 8000);
console.log("Server running at http://localhost:8000/");
</code></pre>

<p><strong>What am I doing wrong?</strong></p>
