-
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.
Migrates tests to Mocha/Chai, minor repo cleanup
jasmine-node is missing some useful functionality and unfortunately it appears abandoned. This commit migrates our tests to mocha/chai, but also affords us the chance to clean up tests a bit. Also includes some minor cleanup: - Updated version of mongoose in package.json, and marked it as a peerDep - Added viveleroi as a contributor to package.json - More entries in gitignore
- Loading branch information
Showing
5 changed files
with
205 additions
and
244 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,2 +1,14 @@ | ||
.idea/ | ||
*.sublime-workspace | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
Icon | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
Thumbs.db | ||
ehthumbs.db | ||
Desktop.ini | ||
$RECYCLE.BIN/ | ||
node_modules/ | ||
.tmp |
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,28 +1,38 @@ | ||
{ | ||
"name": "mongoose-unique-validator", | ||
"version": "0.4.1", | ||
"description": "mongoose-unique-validator is a plugin which adds pre-save validation for unique fields within a Mongoose schema.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "./node_modules/.bin/jasmine-node spec/ --forceexit --captureExceptions" | ||
}, | ||
"keywords": [ | ||
"mongoose", | ||
"unique", | ||
"validator" | ||
], | ||
"author": { | ||
"name": "Blake Haswell", | ||
"email": "[email protected]", | ||
"url": "http://blakehaswell.com/" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/blakehaswell/mongoose-unique-validator.git" | ||
}, | ||
"devDependencies": { | ||
"jasmine-node": "1.14.x", | ||
"mongoose": "3.8.x" | ||
"name": "mongoose-unique-validator", | ||
"version": "0.4.1", | ||
"description": "mongoose-unique-validator is a plugin which adds pre-save validation for unique fields within a Mongoose schema.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha test" | ||
}, | ||
"keywords": [ | ||
"mongoose", | ||
"unique", | ||
"validator" | ||
], | ||
"author": { | ||
"name": "Blake Haswell", | ||
"email": "[email protected]", | ||
"url": "http://blakehaswell.com/" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Mike Botsko", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/blakehaswell/mongoose-unique-validator.git" | ||
}, | ||
"devDependencies": { | ||
"bluebird": "^2.10.2", | ||
"chai": "^3.3.0", | ||
"mocha": "^2.3.3" | ||
}, | ||
"peerDependencies": { | ||
"mongoose": "^4.1.10" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,48 @@ | ||
var mongoose = require('mongoose'); | ||
|
||
// Helper methods/objects for tests | ||
module.exports = { | ||
createUserSchema: function() { | ||
return mongoose.Schema({ | ||
username: { | ||
type: String, | ||
unique: true | ||
}, | ||
email: { | ||
type: String, | ||
index: true, | ||
unique: true | ||
}, | ||
password: { | ||
type: String | ||
} | ||
}); | ||
}, | ||
|
||
createCustomUserSchema: function() { | ||
return mongoose.Schema({ | ||
username: { | ||
type: String, | ||
unique: 'Username is already used.' | ||
}, | ||
email: { | ||
type: String, | ||
index: true, | ||
unique: 'It already exists.' | ||
}, | ||
password: { | ||
type: String | ||
} | ||
}); | ||
}, | ||
|
||
USERS: [{ | ||
username: 'JohnSmith', | ||
email: '[email protected]', | ||
password: 'j0hnNYb0i' | ||
}, { | ||
username: 'Robert Miller', | ||
email: '[email protected]', | ||
password: '@b0B#b0B$b0B%' | ||
}] | ||
}; |
Oops, something went wrong.