Skip to content

Commit

Permalink
No funcionan los test
Browse files Browse the repository at this point in the history
  • Loading branch information
CANCI0 committed Apr 11, 2024
1 parent 4dee312 commit 79951ef
Show file tree
Hide file tree
Showing 9 changed files with 834 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
- run: npm --prefix statsservice test -- --coverage
- run: npm --prefix webapp test -- --coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ jobs:
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix webapp ci
- run: npm --prefix statsservice ci
- run: npm --prefix questionservice ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
- run: npm --prefix statsservice test -- --coverage
- run: npm --prefix webapp test -- --coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sonar.language=js
sonar.projectName=wiq_es1a

sonar.coverage.exclusions=**/*.test.js
sonar.sources=webapp/src/components,webapp/src/pages,users/authservice,users/userservice,gatewayservice
sonar.sources=webapp/src/components,webapp/src/pages,users/authservice,users/userservice,gatewayservice,statsservice
sonar.sourceEncoding=UTF-8
sonar.exclusions=node_modules/**, webapp/src/components/Background/**
sonar.javascript.lcov.reportPaths=**/coverage/lcov.info
44 changes: 44 additions & 0 deletions statsservice/StatsMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const mongoose = require('mongoose');

const stats = new mongoose.Schema({
username: {
type: String,
required: true,
},
gamemode: {
type: String,
required: true,
},
nGamesPlayed: {
type: Number,
required: true,
},
avgPoints: {
type: Number,
required: true,
},
totalPoints: {
type: Number,
required: true,
},
totalCorrectQuestions: {
type: Number,
required: true,
},
totalIncorrectQuestions: {
type: Number,
required: true,
},
ratioCorrect: {
type: Number,
required: true,
},
avgTime: {
type: Number,
required: true,
},
});

const Stats = mongoose.model('Stats', stats);

module.exports = Stats
Loading

0 comments on commit 79951ef

Please sign in to comment.