Add some mocha/chai tests
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
"env": {
|
||||
"node": true,
|
||||
"browser": false,
|
||||
"es6": true
|
||||
"es6": true,
|
||||
"mocha": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018
|
||||
|
||||
@@ -52,7 +52,6 @@ const login = async (req, res, next) => {
|
||||
try {
|
||||
user = await users.getByEmail(req.body.email);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return next(error, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"description": "",
|
||||
"main": "app.js",
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.792.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"express": "^4.17.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
@@ -12,13 +13,17 @@
|
||||
"shortid": "^2.2.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.2.0",
|
||||
"chai-http": "^4.3.0",
|
||||
"eslint": "^7.12.1",
|
||||
"eslint-config-prettier": "^6.15.0",
|
||||
"faker": "^5.1.0",
|
||||
"mocha": "^8.2.1",
|
||||
"prettier": "^2.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
"pretest": "eslint --ignore-path ../.gitignore .",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"test": "mocha",
|
||||
"format": "prettier --write \"**/*.{js,json,md,yml}\""
|
||||
},
|
||||
"author": "",
|
||||
|
||||
Reference in New Issue
Block a user