Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

res.text is undefined #129

Closed
dead-horse opened this issue Oct 22, 2012 · 2 comments
Closed

res.text is undefined #129

dead-horse opened this issue Oct 22, 2012 · 2 comments

Comments

@dead-horse
Copy link

var express = require('express');
var http = require('http');
var app = express();
app.use(function(req, res) {res.end('hello');});
app = http.createServer(app);

module.exports = app;
var request = require('supertest');
var app = require('./app');
app.listen(12355);
request(app).get('/').end(function(err, res) {
  console.log(err, res);
});

in callback, res.text is undefined
supertest @0.4.0
express @3.0.0rc5

But in supertest @0.1.2, everything is ok.

@tj
Copy link
Contributor

tj commented Oct 22, 2012

in later superagents you have to do .buffer() if the response is not text/* or application/json

@dead-horse
Copy link
Author

Oh. The render module forgot to add content-type. Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants