rjz / supertest-session

Persistent sessions for supertest
Other
88 stars 21 forks source link

Use conformant API #13

Closed rjz closed 8 years ago

rjz commented 8 years ago

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.