diff --git a/tests/tests/utils/debug.ts b/tests/tests/utils/debug.ts index c29ac5b0..50eaa522 100644 --- a/tests/tests/utils/debug.ts +++ b/tests/tests/utils/debug.ts @@ -1,16 +1,29 @@ import axios from "axios"; +const fs = require('fs'); export async function getPusherDump(): Promise { + let url = 'http://pusher.workadventure.localhost/dump?token=123'; + if (fs.existsSync('/project')) { + // We are inside a container. Let's use a direct route + url = 'http://pusher/dump?token=123'; + } + return (await axios({ - url: 'http://pusher.workadventure.localhost/dump?token=123', + url, method: 'get', })).data; } export async function getBackDump(): Promise { + let url = 'http://api.workadventure.localhost/dump?token=123'; + if (fs.existsSync('/project')) { + // We are inside a container. Let's use a direct route + url = 'http://back/dump?token=123'; + } + return (await axios({ - url: 'http://api.workadventure.localhost/dump?token=123', + url, method: 'get', })).data; }