From 2b4fc3e23cdbe10f06d13483a67d0ee56fc440ab Mon Sep 17 00:00:00 2001 From: Mister-Mario Date: Thu, 25 Apr 2024 21:23:39 +0200 Subject: [PATCH] Removed an extra mock --- gatewayservice/gateway-service.js | 1 + gatewayservice/gateway-service.test.js | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index 9e2e935..49b59c0 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -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); diff --git a/gatewayservice/gateway-service.test.js b/gatewayservice/gateway-service.test.js index 9629a44..a51f5f1 100644 --- a/gatewayservice/gateway-service.test.js +++ b/gatewayservice/gateway-service.test.js @@ -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(); @@ -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')) {