Testing is complete!! And a nice build runner script to boot

This commit is contained in:
2025-02-05 13:16:12 -07:00
parent 4864de624c
commit 76ea825509
25 changed files with 1453 additions and 103 deletions
@@ -4,19 +4,20 @@ import 'package:dart_frog/dart_frog.dart';
import 'package:mocktail/mocktail.dart';
import 'package:test/test.dart';
import '../../routes/index.dart' as route;
import '../../routes/health.dart' as route;
class _MockRequestContext extends Mock implements RequestContext {}
void main() {
group('GET /', () {
test('responds with a 200 and "Welcome to Dart Frog!".', () {
group('GET /health', () {
test('responds with a 200 and an empty body.', () async {
final context = _MockRequestContext();
final response = route.onRequest(context);
final body = await response.body();
expect(response.statusCode, equals(HttpStatus.ok));
expect(
response.body(),
completion(equals('Welcome to Dart Frog!')),
body,
'',
);
});
});