rjz / supertest-session

Persistent sessions for supertest
Other
88 stars 21 forks source link

Example in documentation does not work, because done is not called in before (and after) #6

Closed scharf closed 9 years ago

scharf commented 9 years ago

The documented example does not work as expected, because the beforedoes not call done.

It should look like:

before(function (done) {
  this.sess = new Session();
  done();
});

after(function (done) {
  this.sess.destroy();
  done();
});
rjz commented 9 years ago

Both Session and Session::destroy should be synchronous methods. In mocha, we should be able to get away with omitting done—but I'm probably missing something, here!

Would you mind detailing the testing setup (runner, version) and any other details that require the use of done?

scharf commented 9 years ago

you are right! There is no need for calling done()! It was another problem with my setting.