From 81b3b8bc2a9a42d84e757cf3920b51aa7d20bfb7 Mon Sep 17 00:00:00 2001 From: Clement Date: Fri, 7 Jun 2024 18:21:18 +0200 Subject: [PATCH] fix tu --- Express/barAndCafe/jest.config.js | 3 +++ Express/barAndCafe/src/openTripMaps.ts | 3 --- Express/barAndCafe/test/openTripMaps.test.ts | 8 ++++++++ bruno/OpenData datatourisme/environments/prod.bru | 5 ++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Express/barAndCafe/jest.config.js b/Express/barAndCafe/jest.config.js index 2c8a283..4d6a8c8 100644 --- a/Express/barAndCafe/jest.config.js +++ b/Express/barAndCafe/jest.config.js @@ -1,5 +1,8 @@ /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { + testPathIgnorePatterns: [ + "/dist/" + ], testTimeout: 10000, preset: 'ts-jest', testEnvironment: 'node', diff --git a/Express/barAndCafe/src/openTripMaps.ts b/Express/barAndCafe/src/openTripMaps.ts index 7d39951..3e29bb3 100644 --- a/Express/barAndCafe/src/openTripMaps.ts +++ b/Express/barAndCafe/src/openTripMaps.ts @@ -189,12 +189,9 @@ export async function getBox(req:express.Request, res: express.Response) { return } - console.log("RATE: ", rate); - if(!rate){ rate = "1"; } - console.log("RATE: ", rate); res.send( await callBox(lon1, lat1, lon2, lat2, rate)) } diff --git a/Express/barAndCafe/test/openTripMaps.test.ts b/Express/barAndCafe/test/openTripMaps.test.ts index 44fdc1f..8b98543 100644 --- a/Express/barAndCafe/test/openTripMaps.test.ts +++ b/Express/barAndCafe/test/openTripMaps.test.ts @@ -219,6 +219,14 @@ describe("Test the otm city path", () => { } ] } + function sleep(milliseconds: number) { + const date = Date.now(); + let currentDate = null; + do { + currentDate = Date.now(); + } while (currentDate - date < milliseconds); + } + sleep(2000); request(app) .get("/otm/box") .query({'lon1':'-1.435199','lon2':'-1.43519', 'lat1':'46.668460', 'lat2':'46.668461'}) diff --git a/bruno/OpenData datatourisme/environments/prod.bru b/bruno/OpenData datatourisme/environments/prod.bru index 424b026..e18cdae 100644 --- a/bruno/OpenData datatourisme/environments/prod.bru +++ b/bruno/OpenData datatourisme/environments/prod.bru @@ -1,5 +1,8 @@ vars { EXPRESS_API: https://drink-tweb.cb85.fr - OTM_KEY: 5ae2e3f221c38a28845f05b6494c021573d9608a4d749ce8af625e0f PB_URL: https://pb-tweb.cb85.fr + TRIPMAP_URL: https://api.opentripmap.com/0.1/ } +vars:secret [ + OTM_KEY +]