
Intermediate
Validate Environment Variables with Zod
Fail fast with a clear message when configuration is missing or malformed — instead of a mysterious crash in production.
15 min 2 steps Next.js
A minimal continuous-integration workflow that runs your test suite on every push and pull request.
25 min2 stepsPublished

npm test scriptCreate .github/workflows/tests.yml:
name: tests
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm testPush the file. Open the Actions tab of your repository to watch the run. A red cross on a pull request means a test failed — open the log to see which one.
Commit your package-lock.json; `npm ci` requires it.

Fail fast with a clear message when configuration is missing or malformed — instead of a mysterious crash in production.
15 min 2 steps Next.js