File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import Fastify from 'fastify' ;
2+ import { describe , expect , it } from 'vitest' ;
3+
4+ describe ( 'health check' , ( ) => {
5+ it ( 'GET /health returns 200' , async ( ) => {
6+ const app = Fastify ( ) ;
7+ app . get ( '/health' , async ( ) => ( { status : 'ok' } ) ) ;
8+
9+ const response = await app . inject ( { method : 'GET' , url : '/health' } ) ;
10+ expect ( response . statusCode ) . toBe ( 200 ) ;
11+ expect ( response . json ( ) ) . toEqual ( { status : 'ok' } ) ;
12+
13+ await app . close ( ) ;
14+ } ) ;
15+ } ) ;
Original file line number Diff line number Diff line change 1+ import { render } from '@testing-library/react' ;
2+ import { describe , expect , it } from 'vitest' ;
3+ import { App } from './App' ;
4+
5+ describe ( 'App' , ( ) => {
6+ it ( 'renders without crashing' , ( ) => {
7+ render ( < App /> ) ;
8+ expect ( document . body ) . toBeTruthy ( ) ;
9+ } ) ;
10+ } ) ;
You can’t perform that action at this time.
0 commit comments