Skip to content

Commit

Permalink
Fix/Revert msw conditions to use global env instead of process env
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelschwobe committed Dec 12, 2023
1 parent 5adb918 commit 1545f91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ init();
global.ENV = getEnv();

// Enable API mocking.
if (ENV.MODE !== "production" && ENV.MOCKS === true) {
if (process.env.NODE_ENV !== "production" && process.env.MOCKS === "true") {
const { server } = await import("../tests/mocks/node");
server.listen();
console.info("[MSW] Mocking enabled.");
if (ENV.MODE === "development") {
if (process.env.NODE_ENV === "development") {
// Only log mocked requests in development mode.
server.events.on("request:start", ({ request }) => {
console.info(request.method, "[MSW]", request.url);
Expand Down

0 comments on commit 1545f91

Please sign in to comment.