title: express body-parser utf-8 error in test
body: <p>Super stumped by this. I have some server code that for some reason throws a UTF-8 error in my tests but works fine when running the server normally:</p>
  
  <p>code:</p>
  
  <pre><code>export default ({ projectId = PROJECT_ID, esHost = ES_HOST } = {}) =&gt; {
    let app = express();
    app.use(cors());
    app.use(bodyParser.json({ limit: '50mb' }));
  
    let http = Server(app);
    let io = socketIO(http);
  
    let server = {
      app,
      io,
      http,
      status: 'off',
      listen(
        port = PORT,
        cb = () =&gt; {
          rainbow(`⚡️ Listening on port ${port} ⚡️`);
        },
      ) {
        this.http.listen(port, () =&gt; {
          main({ io, app, projectId, esHost, port });
          this.status = 'on';
          cb();
        });
      },
      close(cb = () =&gt; {}) {
        if (this.http) {
          this.http.close(() =&gt; {
            this.status = 'off';
            cb();
          });
        } else {
          throw '❗️ cannot close server that has not been started ❗️';
        }
      },
    };
  
    return server;
  };
  </code></pre>
  
  <p>usage (exactly the same, but in jest test body-parser isn't working properly):</p>
  
  <pre><code>import createServer from '../server'
  
  let server = createServer()
  server.listen(5050);
  </code></pre>
  
  <p>I'm using postman, post response outside of test:</p>
  
  <pre><code>{
      "projects": [
          {
              "id": "test",
              "active": true,
              "timestamp": "2018-02-25T21:33:08.006Z"
          },
          {
              "id": "TEST-PROJECT",
              "active": true,
              "timestamp": "2018-03-05T21:34:34.604Z"
          },
          {
              "id": "asd",
              "active": true,
              "timestamp": "2018-03-06T23:29:55.348Z"
          }
      ],
      "total": 3
  }
  </code></pre>
  
  <p>unexpected post response inside jest test server:</p>
  
  <p>
  
  
  
  Error
  
  </p>
  
  <pre>UnsupportedMediaTypeError: unsupported charset &quot;UTF-8&quot;<br> &nbsp; &nbsp;at /Users/awilmer/Projects/arranger/node_modules/body-parser/lib/read.js:83:18<br> &nbsp; &nbsp;at invokeCallback (/Users/awilmer/Projects/arranger/node_modules/raw-body/index.js:224:16)<br> &nbsp; &nbsp;at _combinedTickCallback (internal/process/next_tick.js:131:7)<br> &nbsp; &nbsp;at process._tickCallback (internal/process/next_tick.js:180:9)</pre>
  
  <p>
  </p>