npm install
or yarn install
for dependency installation - Run npm run dev
or yarn dev
for development server - Use npm run build
or yarn build
for production builds - Always run npm run lint
before committing code - Use npm run format
to auto-format code with Prettier - Run npm run type-check
for TypeScript projects - Use environment-specific scripts: npm run dev:local
, npm run build:prod
- Always check package.json
scripts section for available commands - Use npm ci
in CI/CD environments for faster, reliable builds - Run npm audit
regularly to check for security vulnerabilitiesshould return user data when valid ID provided
- Follow AAA pattern: Arrange, Act, Assert - Mock external dependencies and API calls in unit tests - Write integration tests for API endpoints and database interactions - Use npm run test
for running all tests - Use npm run test:watch
during development - Run npm run test:coverage
to check coverage reports - Write end-to-end tests for critical user journeys - Test error handling and edge cases thoroughly - Keep tests isolated and independent of each other