Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
zemirco committed Jul 3, 2015
1 parent 0eb25e3 commit bafce76
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 22 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

BIN = ./node_modules/.bin
MOCHA = $(BIN)/mocha
ESLINT = $(BIN)/eslint

test:
$(MOCHA)

eslint: index.js ./test/*.js
$(ESLINT) $^

.PHONY: test eslint
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/zeMirco/lockit-mongodb-adapter"
"url": "https://github.com/zemirco/lockit-mongodb-adapter"
},
"keywords": [
"lockit",
Expand All @@ -18,21 +18,19 @@
"author": {
"name": "Mirco Zeiss",
"email": "[email protected]",
"twitter": "zeMirco"
"twitter": "zemirco"
},
"license": "MIT",
"dependencies": {
"node-uuid": "~1.4.1",
"ms": "~0.6.2",
"couch-pwd": "0.0.1",
"moment": "^2.6.0",
"mongodb": "^1.4.5"
"mongodb": "^2.0.35",
"ms": "^0.7.1",
"node-uuid": "~1.4.1"
},
"devDependencies": {
"eslint": "^0.24.0",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.10.0",
"grunt-mocha-test": "^0.10.2",
"should": "^3.3.1"
"mocha": "^2.2.5",
"should": "^7.0.1"
}
}
27 changes: 14 additions & 13 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict';

var should = require('should');
var config = require('./config.js');
Expand All @@ -20,7 +21,7 @@ describe('lockit-mongodb-adapter', function() {

it('should create a new user', function(done) {
adapter.save('john', '[email protected]', 'secret', function(err, res) {
if (err) console.log(err);
if (err) {console.log(err); }
res.should.have.property('signupToken');
res.signupToken.should.match(/[0-9a-f]{22}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/);
res.should.have.property('failedLoginAttempts');
Expand All @@ -33,7 +34,7 @@ describe('lockit-mongodb-adapter', function() {

it('should find a user by name', function(done) {
adapter.find('name', 'john', function(err, res) {
if (err) console.log(err);
if (err) {console.log(err); }
res.name.should.equal('john');
res.email.should.equal('[email protected]');
done();
Expand All @@ -42,7 +43,7 @@ describe('lockit-mongodb-adapter', function() {

it('should return undefined when no user is found', function(done) {
adapter.find('name', 'jim', function(err, res) {
if (err) console.log(err);
if (err) {console.log(err); }
should.not.exist(err);
should.not.exist(res);
done();
Expand All @@ -51,7 +52,7 @@ describe('lockit-mongodb-adapter', function() {

it('should find a user by email', function(done) {
adapter.find('email', '[email protected]', function(err, res) {
if (err) console.log(err);
if (err) {console.log(err); }
res.name.should.equal('john');
res.email.should.equal('[email protected]');
done();
Expand All @@ -60,7 +61,7 @@ describe('lockit-mongodb-adapter', function() {

it('should find a user by signup token', function(done) {
adapter.find('signupToken', _tmp_signupToken, function(err, res) {
if (err) console.log(err);
if (err) {console.log(err); }
res.name.should.equal('john');
res.email.should.equal('[email protected]');
done();
Expand All @@ -69,11 +70,11 @@ describe('lockit-mongodb-adapter', function() {

it('should update an existing user', function(done) {
adapter.find('name', 'john', function(err, doc) {
if (err) console.log(err);
if (err) {console.log(err); }
doc.test = 'works';
doc.editet = true;
adapter.update(doc, function(err, res) {
if (err) console.log(err);
adapter.update(doc, function(updateErr, res) {
if (updateErr) {console.log(updateErr); }
res.test.should.equal('works');
res.editet.should.be.true;
done();
Expand All @@ -82,18 +83,18 @@ describe('lockit-mongodb-adapter', function() {
});

it('should remove a user', function(done) {
adapter.save('jeff', '[email protected]', 'secret', function(err, res) {
if (err) console.log(err);
adapter.remove('jeff', function(err, res) {
if (err) console.log(err);
adapter.save('jeff', '[email protected]', 'secret', function(err) {
if (err) {console.log(err); }
adapter.remove('jeff', function(removeErr, res) {
if (removeErr) {console.log(removeErr); }
res.should.be.true;
done();
});
});
});

it('should return an error when remove cannot find a user', function(done) {
adapter.remove('steve', function(err, res) {
adapter.remove('steve', function(err) {
err.message.should.equal('lockit - Cannot find user "steve"');
done();
});
Expand Down

0 comments on commit bafce76

Please sign in to comment.