Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
fix: validation of NODE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
zigapk committed Nov 15, 2023
1 parent 16b8293 commit c770fe0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
environment: 'staging'
- uses: ArtiomTr/jest-coverage-report-action@v2
with:
test-script: source .env && NODE_ENV=development pnpm test
test-script: source .env && pnpm test
8 changes: 6 additions & 2 deletions src/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import { z } from 'zod';
// Base schema for common variables
const baseSchema = {
server: {
NODE_ENV: z.enum(['development', 'test', 'production']),
NODE_ENV: z
.enum(['development', 'test', 'production'])
.default('development'),
SENTRY_AUTH_TOKEN: z.string(),
},
client: {
NEXT_PUBLIC_NODE_ENV: z.enum(['development', 'test', 'production']),
NEXT_PUBLIC_NODE_ENV: z
.enum(['development', 'test', 'production'])
.default('development'),
},
// ... other shared properties
};
Expand Down

0 comments on commit c770fe0

Please sign in to comment.