Skip to content

Commit

Permalink
chore: rename "development" to "local" for slack notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Heneghan committed Feb 8, 2024
1 parent 6f9755c commit 9705b7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api.planx.uk/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("getEnvironment function", () => {

test("Development env", () => {
process.env.NODE_ENV = "development";
expect(getFormattedEnvironment()).toBe("Development");
expect(getFormattedEnvironment()).toBe("Local");
});
});

Expand Down
4 changes: 4 additions & 0 deletions api.planx.uk/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ const getFormattedEnvironment = (): string => {
const pizzaNumber = new URL(process.env.API_URL_EXT!).href.split(".")[1];
environment += ` ${pizzaNumber}`;
}
// For readability redefine development as local for slack warnings
if (environment === "development") {
environment = "local";
}
return capitalize(environment);
};

Expand Down

0 comments on commit 9705b7f

Please sign in to comment.