Skip to content

Instantly share code, notes, and snippets.

@mikelax
Created October 19, 2016 02:00
Show Gist options
  • Save mikelax/bd3c67478b2a61881561b4d07dfefebe to your computer and use it in GitHub Desktop.
Save mikelax/bd3c67478b2a61881561b4d07dfefebe to your computer and use it in GitHub Desktop.
const express = require('express');
const request = require('supertest');
const chai = require('chai');
const should = chai.should();
const app = express();
app.post('/plain', function(req, res){
res.set('Transfer-Encoding', 'chunked'); // <- this is the problem
res.status(200).send('hello');
});
describe('Test plain text response', function() {
it('should handle 200 response', function (done) {
request(app)
.post('/plain')
.expect(200)
.end(function (err, res) {
if (err) return done(err);
// console.log(res.text);
res.text.should.equal('hello');
done();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment