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

Use conformant API #13

Closed
rjz opened this issue Oct 3, 2015 · 0 comments
Closed

Use conformant API #13

rjz opened this issue Oct 3, 2015 · 0 comments

Comments

@rjz
Copy link
Owner

rjz commented Oct 3, 2015

supertest-session has two deviations from the supertest API:

  1. the package export is a function wrapping definition of the Session class with a specific config
  2. Sessions are created using the new keyword, but may not adjust their configuration at this time

Both decisions may be convenient in certain cases, but they limit runtime configuration (see #12) and add unnecessary complexity to the public API. An easy fix? Create Session instances via a supertest-esque factory function.

rjz added a commit that referenced this issue Oct 3, 2015
This change brings the supertest-session API closer in-line with the
`supertest` API it wraps. Dependents adopting the new API should create
sessions using the exported factory function:

    var request = require('supertest-session');

    request(myApp, myOpts)
      .get('/hello')
      ...

The API remains back-compatible for the time being, though legacy usage
should be considered deprecated and will be removed in the future.
rjz added a commit that referenced this issue Oct 3, 2015
This change brings the supertest-session API closer in-line with the
`supertest` API it wraps. Dependents adopting the new API should create
sessions using the exported factory function:

    var request = require('supertest-session');

    request(myApp, myOpts)
      .get('/hello')
      ...

The API remains back-compatible for the time being, though legacy usage
should be considered deprecated and will be removed in the future.
rjz added a commit that referenced this issue Oct 3, 2015
This change brings the supertest-session API closer in-line with the
`supertest` API it wraps. Dependents adopting the new API should create
sessions using the exported factory function:

    var request = require('supertest-session');

    request(myApp, myOpts)
      .get('/hello')
      ...

The API remains back-compatible for the time being, though legacy usage
should be considered deprecated and will be removed in the future.
rjz added a commit that referenced this issue Oct 3, 2015
This change brings the supertest-session API closer in-line with the
`supertest` API it wraps. Dependents adopting the new API should create
sessions using the exported factory function:

    var request = require('supertest-session');

    request(myApp, myOpts)
      .get('/hello')
      ...

The API remains back-compatible for the time being, though legacy usage
should be considered deprecated and will be removed in the future.
@rjz rjz closed this as completed Oct 3, 2015
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

1 participant