supertest-session
Advanced tools
Comparing version
@@ -115,3 +115,5 @@ var assign = require('object-assign'), | ||
module.exports = function (app, options) { | ||
if (typeof app != 'function') { | ||
// Check for legacy interface and provide compatibility | ||
if (app && app.app) { | ||
return deprecatedLegacySession(app); | ||
@@ -118,0 +120,0 @@ } |
{ | ||
"name": "supertest-session", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Cookie-based session persistence for Supertest", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -50,2 +50,27 @@ var assert = require('assert'), | ||
}); | ||
describe('(#16) requesting URL of existing app', function () { | ||
var serverUrl, test; | ||
beforeEach(function () { | ||
// use supertest to set up the app.js server, returning a `Test` instance | ||
test = session(app).request('get', ''); | ||
// obtain the running server's URL | ||
serverUrl = test.url; | ||
}); | ||
afterEach(function (done) { | ||
test.end(done); | ||
}); | ||
it('behaves correctly', function (done) { | ||
sess = session(serverUrl) | ||
.get('/') | ||
.expect(200) | ||
.expect('GET,,1') | ||
.end(done); | ||
}); | ||
}); | ||
}); | ||
@@ -52,0 +77,0 @@ |
12692
0.85%272
7.94%14
-12.5%