Skip to content

Commit

Permalink
modified tests and sonar properties to exclude a model and a utils
Browse files Browse the repository at this point in the history
  • Loading branch information
uo289029 committed Apr 6, 2024
1 parent 41e986d commit e08821a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions questionsgenerator/questions-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,10 @@ describe('Questions Service', () => {
expect(response.body).toHaveProperty('correctAnswerLabel');
expect(response.body).toHaveProperty('answerLabelSet');
});
it('should get a new question on POST /getQuestion', async () => {
const category = "todo";

const response = await request(app).post('/getQuestion').send({ category });
expect(response.status).not.toBe(500);
});
});
9 changes: 9 additions & 0 deletions record/historial-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ describe('Historial Service', () => {

expect(response.status).toBe(200);
expect(response.body).toHaveProperty('games');

const game = response.body.games[0];
expect(game).toHaveProperty('_id', 'testGameId');
expect(game).toHaveProperty('user');
expect(game.user).toHaveProperty('_id', 'testUserId');
expect(game.user).toHaveProperty('username', 'Example username');
expect(game.user).toHaveProperty('password', 'Example password');
expect(game.user).toHaveProperty('createdAt');
expect(game).toHaveProperty('questions');
});

it('should get a new question on POST /deleteTempQuestions', async () => {
Expand Down
1 change: 1 addition & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ sonar.language=js
sonar.projectName=wiq_es1b

sonar.coverage.exclusions=**/*.test.js
sonar.exclusions=record/auth-model.js,questionsgenerator/wikidata/WikiUtils.js
sonar.sources=webapp/src/components,users/authservice,users/userservice,gatewayservice,record,questionsgenerator
sonar.sourceEncoding=UTF-8
sonar.exclusions=node_modules/**
Expand Down

0 comments on commit e08821a

Please sign in to comment.