Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 1.9 KB

README.md

File metadata and controls

49 lines (32 loc) · 1.9 KB

CA Next Template - WIP

CA NextJS Template 2024

A template for creating new NextJS apps with: TailwindCSS, Typescript, Jest & Playwright

Commands

pnpm i Installs the dependencies
pnpm dev Starts the development server
pnpm build Builds the application for production
pnpm start Starts the production server, only if built
pnpm lint Runs the linter
pnpm test Runs the unit tests
pnpm test:watch Runs the unit tests in watch mode
pnpm test:e2e Runs the end-to-end tests

Open http://localhost:3000 with your browser to see the result.

Environment Variables

Env variables are managed and validated for type safety with @t3-oss/env-nextjs and require configuration in the file @/lib/env.js.

Testing

Unit tests

Jest is used for unit tests. You can run the tests once or in watch mode.

  • pnpm test // runs once
  • pnpm test:watch // runs in watch mode

End-to-end tests

Playwright is used for end-to-end tests. A github action is configured to run the tests on push and pull request.
Includes a smoke test to ensure home page renders.

To run playwright locally, you must build and start the server first.

  1. pnpm build && pnpm start
  2. pnpm test:e2e

CI & Deployment

Includes github action to run E2E test (playwright) on successful deployment of vercel preview.