diff --git a/questionservice/server.test.js b/questionservice/server.test.js new file mode 100644 index 0000000..df73004 --- /dev/null +++ b/questionservice/server.test.js @@ -0,0 +1,21 @@ +const request = require('supertest'); +const app = require('./server'); +const fs = require('fs'); + +afterAll(async () => { + app.close(); +}); + +describe('GET /pregunta', () => { + it('debería devolver una pregunta y respuestas con éxito', async () => { + const response = await request(app).get('/pregunta'); + expect(response.statusCode).toBe(200); + expect(response.body).toHaveProperty('question'); + expect(response.body).toHaveProperty('answerGood'); + expect(response.body).toHaveProperty('answers'); + expect(response.body.answers).toHaveLength(4); + }); + + + +});