Skip to content

Commit

Permalink
Test por defecto (se crea pero no comrpueba nada)
Browse files Browse the repository at this point in the history
  • Loading branch information
baraganio committed Apr 22, 2024
1 parent ec4b56d commit c8da895
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions questions/creationservice/creation-service.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const request = require('supertest');
const { MongoMemoryServer } = require('mongodb-memory-server');

let mongoServer;
let app;

beforeAll(async () => {
mongoServer = await MongoMemoryServer.create();
const mongoUri = mongoServer.getUri();
process.env.MONGODB_URI = mongoUri;
app = require('./createquestion-service');
});

afterAll(async () => {
app.close();
await mongoServer.stop();
});

describe('Retrieve Service', () => {
it('should add a new user on GET /createquestion', async () => {

const response = await request(app).get('/createquestion');
expect(response.status).toBe(200);
});
});
25 changes: 25 additions & 0 deletions questions/retrieveservice/retrieve-service.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const request = require('supertest');
const { MongoMemoryServer } = require('mongodb-memory-server');

let mongoServer;
let app;

beforeAll(async () => {
mongoServer = await MongoMemoryServer.create();
const mongoUri = mongoServer.getUri();
process.env.MONGODB_URI = mongoUri;
app = require('./retrieve-service');
});

afterAll(async () => {
app.close();
await mongoServer.stop();
});

describe('Retrieve Service', () => {
it('should add a new user on GET /getquestionshistory', async () => {

const response = await request(app).get('/getquestionshistory');
expect(response.status).toBe(200);
});
});

0 comments on commit c8da895

Please sign in to comment.