rjz / supertest-session

Persistent sessions for supertest
Other
89 stars 21 forks source link

pass envs to application #12

Closed refextu closed 9 years ago

refextu commented 9 years ago

the following documentation is missleading, but obvious passing envs to the app ist not possible, when the app is already initialized.

var Session = require('supertest-session')({
  app: require('../../path/to/app'),
  envs: { NODE_ENV: 'development' }
});

what you have to do work with envs consistently:

process.env['NODE_ENV'] = "development";
var Session = require('supertest-session')({
  app: require('../../path/to/app'),
}); 

I would suggest to depreciate the use of your envs, cause the status of envs changes over runtime.

rjz commented 9 years ago

Absolutely! If you're willing to submit a PR to this effect, it should be a pretty uncontroversial merge.