Skip to content

Commit

Permalink
add integration test for dart async header functions
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmossas committed Jun 3, 2024
1 parent 579a0d3 commit f962b17
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/clients/dart/test/test_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ Future<void> main() async {
expect(result.int64, equals(input.int64));
expect(result.uint64, equals(input.uint64));
});
test("supports async header functions", () async {
final asyncHeaderClient = TestClient(
baseUrl: baseUrl,
headers: () async {
await Future.delayed(Duration(milliseconds: 100));
return {"x-test-header": "async-test"};
},
);
final result = await asyncHeaderClient.tests.sendObject(input);
expect(result.array.length, equals(input.array.length));
expect(result.int64, equals(input.int64));
expect(result.uint64, equals(input.uint64));
});
test("unauthenticated RPC requests return a 401 error", () async {
try {
await unauthenticatedClient.tests.sendObject(input);
Expand Down

0 comments on commit f962b17

Please sign in to comment.