Development Guides
Testing Guide
Testing strategy, type checking, linting, and validation approaches.
Testing Guide
BISO Sites uses a pragmatic testing approach focused on type safety, linting, and manual validation.
Type Checking
Run TypeScript checks:
# Check all apps and packages
bun run check-types
# Check specific app
cd apps/web && bun run tsc --noEmitLinting
ESLint configuration for code quality:
# Lint all
bun run lint
# Lint specific app
cd apps/web && bun run lintBuild Validation
The build process validates the entire application:
# Build all
bun run build
# Build specific app
bun run build --filter=webManual Testing Workflow
Start Development Server
bun run dev --filter=webTest Critical Flows
- User registration and login
- Product purchase flow
- Event registration
- Admin content creation
Verify Responsiveness
Test on different screen sizes:
- Mobile (375px)
- Tablet (768px)
- Desktop (1440px)
Check Both Languages
Test in English (/en) and Norwegian (/no)
Testing Patterns
Validate with Zod
import { z } from 'zod';
const schema = z.object({
email: z.string().email(),
age: z.number().min(18),
});
// This will throw if invalid
const validated = schema.parse(userInput);Type-Safe Forms
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
const { register, handleSubmit } = useForm({
resolver: zodResolver(schema), // Automatic validation
});Error Boundaries
// app/error.tsx
'use client';
export default function Error({ error, reset }: {
error: Error;
reset: () => void;
}) {
return (
<div>
<h2>Something went wrong!</h2>
<button onClick={reset}>Try again</button>
</div>
);
}Related Documentation
ℹ️
Testing Philosophy
BISO Sites prioritizes TypeScript type safety, ESLint rules, and build-time validation over extensive unit testing. This approach works well for rapid development while maintaining quality.
