Skip to content

Commit

Permalink
Removed an extra mock
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Mario committed Apr 25, 2024
1 parent ada02ec commit 2b4fc3e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ app.post('/adduser', async (req, res) => {
try {
// Forward the add user request to the user service
const userResponse = await axios.post(userServiceUrl+'/adduser', req.body);
console.log(userResponse)
res.json(userResponse.data);
} catch (error) {
manageError(res, error);
Expand Down
7 changes: 0 additions & 7 deletions gatewayservice/gateway-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const request = require('supertest');
const axios = require('axios');
const jwt = require('jsonwebtoken');
const app = require('./gateway-service');
const { cat } = require('asciidoctor-emoji/dist/node/twemoji-map');

afterAll(async () => {
app.close();
Expand Down Expand Up @@ -173,12 +172,6 @@ describe('Gateway Service without mocked micro services', () => {
}
});

axios.post.mockImplementation((url, data) => {
if (url.endsWith('/login')) {
throw new Error("Important information");
}
});

it('should not forward login request and give 500', async () => {
axios.post.mockImplementation((url, data) => {
if (url.endsWith('/login')) {
Expand Down

0 comments on commit 2b4fc3e

Please sign in to comment.