Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problems with coverage #6

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install module
run: npm ci
- name: Testing coverage
run: npm run test:dev
run: npm run test:prod
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dev": "tsc -w",
"test": "jest",
"test:dev": "cross-env NODE_ENV=test jest --watchAll --coverage",
"test:prod": "jest --passWithNoTests --coverage",
"lint": "eslint . --ext .ts",
"prepare": "husky"
},
Expand Down
5 changes: 2 additions & 3 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
sonar.projectKey=Francisco-Hernandez-Final-Project-202402-Mad-Back

sonar.projectKey=isdi-coders-2023_Francisco-Hernandez-Final-Project-202402-Mad-Back
sonar.organization=isdi-coders-2023

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=Danielle-Quintiliani-Final-Project-202402-Mad-Back
#sonar.projectName=Francisco-Hernandez-Final-Project-202402-Mad-Back
#sonar.projectVersion=1.0


Expand Down
16 changes: 11 additions & 5 deletions src/routers/users.routers/user.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ export class UserRouter {

this.router.get('/:id', userController.getById.bind(userController));

this.router.post('/', userController.create.bind(userController));

this.router.patch('/:id', userController.update.bind(userController));

this.router.delete('/:id', userController.delete.bind(userController));
this.router.patch(
'/:id',
authMiddleware.authentication.bind(authMiddleware),
userController.update.bind(userController)
);

this.router.delete(
'/:id',
authMiddleware.authentication.bind(authMiddleware),
userController.delete.bind(userController)
);
}
}
2 changes: 1 addition & 1 deletion src/services/auth.services/auth.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type Payload = {
} & jwt.JwtPayload;

export class Auth {
static secret = process.env.SECRES_JWT;
static secret = process.env.SECRET_JWT;

static async hash(value: string) {
return hash(value, 10);
Expand Down
Loading