GithubHelp home page GithubHelp logo

Comments (8)

strk avatar strk commented on May 21, 2024

Oh, supertest is 0.0.1

from supertest.

strk avatar strk commented on May 21, 2024

but also fails with supertest 0.1.0

from supertest.

tj avatar tj commented on May 21, 2024

0.4.x will be left in the dust reasonably soon by everyone I would imagine, 3.x isn't even relased yet so I have no intention of supporting 0.4.x

from supertest.

strk avatar strk commented on May 21, 2024

wait a second, I'm talking about supertest not supporting a released express version (2.4.3 or 2.5.1)

If you want this has nothing to do with node-0.4 (except in the part where I would prefer NOT to upgrade express).

If it is intentional to support only express-3.0.0 you write it so in big letters somewhere, or even throw an exception when an older version of an express object is passed to you (dunno how easy would the latter be).

But are you sure you want to restrict the testing capability of such nice tool ?

from supertest.

tj avatar tj commented on May 21, 2024

im fine with supporting it but I dont want to personally maintain it. It should work though, express 2x was an http.Server like any other and supertest works fine with regular http.Server's

from supertest.

strk avatar strk commented on May 21, 2024

I think I was getting my failures with node-0.8, will try with node-0.6

from supertest.

topliceanu avatar topliceanu commented on May 21, 2024

@strk i'm also having similar problems with express 2.5.x.
The way i solved them is by asserting against the Response object passed to the callback on .end()

request(app)
  .get('/')
  .end( function (err, response) {
    if (err) throw err;
    assert.equal(response.statusCode, 200);
  });

However this does not work for PUT/POST request because .send() doesn't seem to work (request.body is undefined)

from supertest.

aseemk avatar aseemk commented on May 21, 2024

I'm using Express 2.5.9 and using supertest regularly works fine for me, FWIW! (Edit: on Node 0.6.)

from supertest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.