Skip to content

Commit

Permalink
Change port in route unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Luciano Gorza <[email protected]>
  • Loading branch information
lucianogorza committed Sep 25, 2023
1 parent 148b77b commit 6e23821
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getUpdatesRoute } from './get-updates';
import axios from 'axios';

const serverAddress = '127.0.0.1';
const port = Math.floor(Math.random() * 60000) + 5000;
const port = 10002; //assign a different port in each unit test
axios.defaults.baseURL = `http://${serverAddress}:${port}`;

const mockedGetUpdates = getUpdates as jest.Mock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getUserPreferences } from '../../services/user-preferences';
import { getUserPreferencesRoutes } from './get-user-preferences';

const serverAddress = '127.0.0.1';
const port = Math.floor(Math.random() * 60000) + 5000;
const port = 10003; //assign a different port in each unit test
axios.defaults.baseURL = `http://${serverAddress}:${port}`;

const mockedGetUserPreferences = getUserPreferences as jest.Mock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { updateUserPreferences } from '../../services/user-preferences';
import { updateUserPreferencesRoutes } from './update-user-preferences';

const serverAddress = '127.0.0.1';
const port = Math.floor(Math.random() * 60000) + 5000;
const port = 10004; //assign a different port in each unit test
axios.defaults.baseURL = `http://${serverAddress}:${port}`;

const mockedUpdateUserPreferences = updateUserPreferences as jest.Mock;
Expand Down

0 comments on commit 6e23821

Please sign in to comment.