Created
October 19, 2016 02:00
-
-
Save mikelax/bd3c67478b2a61881561b4d07dfefebe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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