forked from koajs/generic-session
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '6bd4f3ba5f6c5ce88c485be778b21a95c0aab84a'
# Conflicts: # lib/session.js
- Loading branch information
Showing
13 changed files
with
465 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- "4" | ||
- "5" | ||
- "6" | ||
script: "make test-travis" | ||
after_script: "npm install [email protected] && cat ./coverage/lcov.info | coveralls" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,11 @@ | |
"name": "koa-generic-session", | ||
"description": "koa generic session store by memory, redis or others", | ||
"repository": "koajs/generic-session", | ||
"version": "1.10.1", | ||
"version": "1.11.3", | ||
"files": [ | ||
"lib", | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"koa", | ||
"middleware", | ||
|
@@ -11,21 +15,22 @@ | |
"author": "dead_horse <[email protected]>", | ||
"dependencies": { | ||
"copy-to": "~2.0.1", | ||
"crc": "~3.3.0", | ||
"crc": "~3.4.0", | ||
"debug": "*", | ||
"parseurl": "~1.3.0", | ||
"uid-safe": "~2.1.0" | ||
"parseurl": "~1.3.1", | ||
"uid-safe": "~2.1.1" | ||
}, | ||
"devDependencies": { | ||
"autod": "~2.4.2", | ||
"blanket": "*", | ||
"contributors": "*", | ||
"istanbul-harmony": "*", | ||
"koa": "~1.1.2", | ||
"koa-redis": "~1.0.1", | ||
"mm": "~1.3.5", | ||
"koa": "~1.2.0", | ||
"koa-redis": "~2.1.1", | ||
"mm": "~1.5.0", | ||
"mocha": "2", | ||
"should": "~7.1.1", | ||
"pedding": "^1.0.0", | ||
"should": "~10.0.0", | ||
"supertest": "~0.13.0" | ||
}, | ||
"engines": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/**! | ||
* koa-generic-session - test/override.test.js | ||
* Copyright(c) 2016 | ||
* MIT Licensed | ||
* | ||
* Authors: | ||
* Evan King <[email protected]> (http://honoredsoft.com) | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/** | ||
* Module dependencies. | ||
*/ | ||
|
||
var app = require('./support/override'); | ||
var request = require('supertest'); | ||
var mm = require('mm'); | ||
var should = require('should'); | ||
|
||
describe('test/override.test.js', function () { | ||
var cookie; | ||
before(function (done) { | ||
request(app) | ||
.get('/session/update') | ||
.expect(/1/) | ||
.end(function (err, res) { | ||
cookie = res.headers['set-cookie'].join(';'); | ||
done(err); | ||
}); | ||
}); | ||
|
||
function req(path, expectBody, expectCookie, done) { | ||
request(app) | ||
.get('/session/' + path) | ||
.set('cookie', cookie) | ||
.end(function (err, res) { | ||
should(res.text).match(expectBody); | ||
(expectCookie) | ||
? should.exist(res.headers['set-cookie']) | ||
: should.not.exist(res.headers['set-cookie']); | ||
done(err); | ||
}); | ||
} | ||
|
||
it('should save modified session', req.bind(null, 'update', /2, null/, true)); | ||
it('should prevent saving modified session', req.bind(null, 'update/prevent', /3, false/, false)); | ||
it('should force saving unmodified session', req.bind(null, 'read/force', /2, true/, true)); | ||
it('should prevent deleting session', req.bind(null, 'remove/prevent', /0, false/, false)); | ||
it('should not have fresh session', req.bind(null, 'read', /2, null/, false)); | ||
it('should delete session on force-save', req.bind(null, 'remove/force', /0, true/, true)); | ||
it('should have fresh session', req.bind(null, 'read', /0, null/, true)); | ||
|
||
}); |
Oops, something went wrong.