withToken method

DoxTestClient withToken(
  1. String token
)

a copy of this client that sends Authorization: Bearer <token>.

TestResponse res = await client.withToken(token).get('/api/me');

Implementation

DoxTestClient withToken(String token) {
  return withHeaders(<String, String>{
    HttpHeaders.authorizationHeader: 'Bearer $token',
  });
}