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

headers checked before status code #173

Closed
openhoat opened this issue Oct 24, 2014 · 1 comment · Fixed by #239
Closed

headers checked before status code #173

openhoat opened this issue Oct 24, 2014 · 1 comment · Fixed by #239
Milestone

Comments

@openhoat
Copy link

The response headers are checked before the response status code, so in the following test, I expect :

expected 200 "OK", got 404 "Not Found"

instead of :

expected "Content-Type" of "application/json; charset=ISO-8859-1", got "text/html; charset=utf-8"

Source to reproduce :

    it('should return a status code error', function (done) {
        supertest('http://hoat.fr')
          .get('/notfound')
          .expect(200)
          .expect('Content-Type', 'application/json; charset=ISO-8859-1')
          .end(done);
    });
@openhoat
Copy link
Author

Fix : In test.js, move the lines to 201-207 to 155

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

Successfully merging a pull request may close this issue.

2 participants