forked from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from Arquisoft/PruebaConjunto
Prueba conjunto
- Loading branch information
Showing
6 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const request = require('supertest'); | ||
let app; | ||
|
||
beforeAll(async () => { | ||
app = require('./question-service'); | ||
}); | ||
|
||
afterAll(async () => { | ||
app.close(); | ||
}); | ||
|
||
describe('GET /questions', () => { | ||
it('should respond with a question, one correct answer and three incorrect answers', async () => { | ||
const response = await request(app) | ||
.post('/questions') | ||
.expect(200); | ||
|
||
expect(response.body).toHaveProperty('pregunta'); | ||
expect(response.body).toHaveProperty('correcta'); | ||
expect(response.body).toHaveProperty('incorrectas'); | ||
expect(response.body.incorrectas).toHaveLength(3); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters