Skip to content

Commit

Permalink
eslint files to remove unsed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmota committed Mar 10, 2019
1 parent 326fa95 commit 69656de
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
23 changes: 23 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"plugins": ["node"],
"extends": ["eslint:recommended", "plugin:node/recommended"],
"rules": {
"node/exports-style": ["error", "module.exports"],
"node/no-unsupported-features/es-syntax": "off",
"node/no-unpublished-require" : "off",
"no-process-exit" : "off"
},
"globals": {
"describe": true,
"it": true,
"expect": true,
"app": true,
"beforeEach": true,
"request": true,
"before": true,
"supertest": true,
"afterEach": true,
"context": true,
"setupApp": true
}
}
4 changes: 2 additions & 2 deletions controllers/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const postUser = async(req, res) => {

try {

errors = await req.asyncValidationErrors();
await req.asyncValidationErrors();

const user = await userRepository.storeUser(req.body);
return res.send(user);
Expand Down Expand Up @@ -110,7 +110,7 @@ const putUserById = async(req, res) => {

try {

errors = await req.asyncValidationErrors();
await req.asyncValidationErrors();

const user = await userRepository.putUserGivenId(id, req.body);

Expand Down
2 changes: 1 addition & 1 deletion test/integration/controllers.User.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ describe('controllers/User Integration Test', () => {
created : faker.date.past()
}

user = await new userModel(data).save();
const user = await new userModel(data).save();

const result = await request
.delete(`/v1/user/${user._id}`)
Expand Down
23 changes: 0 additions & 23 deletions test/integration/repositories.User.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,6 @@ const faker = require('faker');
mongoose.models = {};
mongoose.modelSchemas = {};

const insertNUsers = async(n) => {

let p = [];

for(let i=0;i<n;i++){

const data = {
givenName : faker.name.firstName(),
familyName : faker.name.lastName(),
email : faker.internet.email(),
created : faker.date.past()
}

p.push(new userModel(data).save())
}

await Promise.all(p)

return;

};


describe('repositories/User Integration test', () => {

require("./../../config/db");
Expand Down

0 comments on commit 69656de

Please sign in to comment.