Skip to content

Commit

Permalink
v8
Browse files Browse the repository at this point in the history
  • Loading branch information
f3ath committed Jul 2, 2024
1 parent d34b918 commit 86db956
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 65 deletions.
26 changes: 26 additions & 0 deletions test/unit/http/logging_middleware_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'dart:convert';

import 'package:http_interop/http_interop.dart';
import 'package:json_api/http.dart';
import 'package:test/expect.dart';
import 'package:test/scaffolding.dart';

main() {
Response response = Response(200, Body.text('hello', utf8), Headers());

Future<Response> handler(Request rq) async => response;

group('Logging Middleware', () {
test('Can log', () async {
Request? loggedRq;
Response? loggedRs;

final request = Request('get', Uri(host: 'localhost'), Body(), Headers());
final response = await loggingMiddleware(handler,
onRequest: (r) => loggedRq = r,
onResponse: (r) => loggedRs = r)(request);
expect(loggedRq, same(request));
expect(loggedRs, same(response));
});
});
}
65 changes: 0 additions & 65 deletions test/unit/server/cors_middleware_test.dart

This file was deleted.

0 comments on commit 86db956

Please sign in to comment.