Coder Social home page Coder Social logo

Clarity in Readme about supertest-session HOT 6 CLOSED

rjz avatar rjz commented on July 27, 2024 1
Clarity in Readme

from supertest-session.

Comments (6)

rjz avatar rjz commented on July 27, 2024

Good catch—thanks, @Aaronik! That spec definitely shouldn't pass as written.

I'd be very happy to merge a PR changing to a before block, or—if we want to keep state clean between assertions—nesting the 'logged-in' portion of the example inside a separate describe with appropriate setup.

from supertest-session.

Aaronik avatar Aaronik commented on July 27, 2024

Cool 😄 Happy to do either! Any preference?

from supertest-session.

rjz avatar rjz commented on July 27, 2024

The separate block may be a little clearer for demonstrating session re-use? Something like:

describe('after authenticating session', function () {

  var authenticatedSession = null;

  beforeEach(function (done) {
    testSession.post('/signin')
      .send({ username: 'foo', password: 'password' })
      .expect(200)
      .end(function (err) {
        if (err) return done(err);
        authenticatedSession = testSession;
        return done();
      });
  });

  it('should get a restricted page', function (done) {
    authenticatedSession.get('/restricted')
      .expect(200)
      .end(done);
  });
});

from supertest-session.

Aaronik avatar Aaronik commented on July 27, 2024

Hmmm.. have a branch going, but it's looking like I don't have access rights enough to create a new PR - I sure hope I'm not doing something wrong 😊

$ git push origin readme/signin/22 

ERROR: Permission to rjz/supertest-session.git denied to Aaronik.
fatal: Could not read from remote repository.

And of course

$ git remote -v

origin  [email protected]:rjz/supertest-session.git (fetch)
origin  [email protected]:rjz/supertest-session.git (push)

from supertest-session.

rjz avatar rjz commented on July 27, 2024

@Aaronik looks like it's trying to push to this repo. If you fork to aaronik/supertest-session and open the pull request from the fork (using the web UI) we should be in business!

from supertest-session.

Aaronik avatar Aaronik commented on July 27, 2024

Aight check this: #23 Never done this type of PR before so if I'm doing it wrong, very happy to continue massaging the process if you don't mind holding my hand through it :)

from supertest-session.

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.