Skip to content

Commit

Permalink
Proxy DEBUG to NEXT_PUBLIC_DEBUG in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
codeincontext committed Oct 29, 2024
1 parent c4e41d9 commit 34b2810
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/nextjs/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import type { StorybookConfig } from "@storybook/nextjs";
import { join, dirname, resolve } from "path";
import webpack from "webpack";

process.env.NEXT_PUBLIC_DEBUG = process.env.DEBUG;

/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
Expand Down
2 changes: 2 additions & 0 deletions apps/nextjs/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require("@testing-library/jest-dom");

process.env.NEXT_PUBLIC_DEBUG = process.env.DEBUG;

// Mock Next.js Image component
jest.mock("next/image", () => ({
__esModule: true,
Expand Down

0 comments on commit 34b2810

Please sign in to comment.