Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mongodb-6'
Browse files Browse the repository at this point in the history
  • Loading branch information
pirxpilot committed Dec 25, 2023
2 parents a7c35c3 + 4f1c68b commit d1bb3f4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
1 change: 0 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"eqnull": true,
"immed": true,
"latedef": "nofunc",
"mocha" : true,
"newcap": true,
"noarg": true,
"node": true,
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ lint:
./node_modules/.bin/jshint *.js lib test

test:
./node_modules/.bin/mocha --recursive
node --test

.PHONY: check lint test
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@
"debug": "~4"
},
"peerDependencies": {
"mniam": "~3"
"mniam": "~4"
},
"devDependencies": {
"@pirxpilot/jshint": "^3.0.1",
"express-session": "^1.11.2",
"jshint": "~2",
"mniam": "~3",
"mocha": "~10",
"mniam": "~4",
"should": "~13"
},
"files": [
"index.js",
"lib"
]
}
}
18 changes: 9 additions & 9 deletions test/store.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const { after, describe, beforeEach, it } = require('node:test');

const should = require('should');
const sessionMiddleware = require('express-session');
const MniamStore = require('../lib/store')(sessionMiddleware);

const db = require('mniam').db('mongodb://localhost/mniam-store-test');

/*global describe, it, after, beforeEach */

describe('MniamStore', function () {
const key = 'abcd-efgh';
const value = {
Expand All @@ -22,10 +22,10 @@ describe('MniamStore', function () {

after(async function () {
await db.drop();
db.close();
await db.close();
});

it('should set session data', function (done) {
it('should set session data', function (_, done) {
const store = new MniamStore({ db });

store.set(key, value, function (err) {
Expand All @@ -45,7 +45,7 @@ describe('MniamStore', function () {
});
});

it('should update timestamp when touched', function (done) {
it('should update timestamp when touched', function (_, done) {
const store = new MniamStore({ db });
let modOrig;

Expand All @@ -72,7 +72,7 @@ describe('MniamStore', function () {
});
});

it('should ignore touch to non-existing sessions', function (done) {
it('should ignore touch to non-existing sessions', function (_, done) {
const store = new MniamStore({ db });

store.touch(key, null, function (err) {
Expand All @@ -84,7 +84,7 @@ describe('MniamStore', function () {
});
});

it('should get session data', function (done) {
it('should get session data', function (_, done) {
const store = new MniamStore({ db });

sessions.insertOne({ _id: key, session: value, }).then(() => {
Expand All @@ -99,7 +99,7 @@ describe('MniamStore', function () {
}, done);
});

it('should return empty when no session found', function (done) {
it('should return empty when no session found', function (_, done) {
const store = new MniamStore({ db });

store.get('_not_here', function (err, session) {
Expand All @@ -109,7 +109,7 @@ describe('MniamStore', function () {
});
});

it('should destroy session data', function (done) {
it('should destroy session data', function (_, done) {
const store = new MniamStore({ db });

store.set(key, value, function (err) {
Expand Down

0 comments on commit d1bb3f4

Please sign in to comment.