Skip to content

Commit

Permalink
[api] override shell variables when running tests, add minio port to …
Browse files Browse the repository at this point in the history
….env.test
  • Loading branch information
freemvmt committed Aug 2, 2024
1 parent 2dd0203 commit b4d202c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions api.planx.uk/.env.test.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ EDITOR_URL_EXT=example.com
HASURA_GRAPHQL_URL=http://hasura:8080/v1/graphql
HASURA_PLANX_API_KEY=👻

# Minio object storage server port
MINIO_PORT=1234

# Integrations
BOPS_API_TOKEN=👻
BOPS_API_TOKEN=👻
Expand Down
5 changes: 4 additions & 1 deletion api.planx.uk/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import dotenv from "dotenv";
import { queryMock } from "./tests/graphqlQueryMock";

dotenv.config({ path: "./.env.test" });
dotenv.config({
path: "./.env.test",
override: true,
});

beforeEach(() => {
queryMock.setup(process.env.HASURA_GRAPHQL_URL);
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/modules/file/service/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("s3 Factory", () => {
});

it("returns Minio config for local development", () => {
expect(s3Factory()).toHaveProperty("endpoint.host", "minio");
expect(s3Factory()).toHaveProperty("endpoint.host", "minio:1234");
});

["pizza", "staging", "production"].forEach((env) => {
Expand Down

0 comments on commit b4d202c

Please sign in to comment.