79415884

Date: 2025-02-05 19:01:11
Score: 0.5
Natty:
Report link

a quick and dirty is to mock the variable in the jest files and avoid the import altogether:

jest.mock("~/config", () => ({ ENV_VARIABLE: "//MOCK_BASE_PATH/api/v0" }));

you may need to re-export the file from a ts file:

~/config.ts

export const ENV_VARIABLE = import.meta.env.VITE_ENV_VARIABLE
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: KHB