You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature
Relic endpoints should be just as easy to test as the Serverpod Endpoint classes. To be inline with the current design, a new helper called withRelic should be created. It should have a similar signature with sessionBuilder as the first argument, but instead of endpoints a client object should be given as the second argument.
withRelic('Example Endpoint', (sessionBuilder, client) {
test('Create user', () {
var headers = {
'Content-Type':'application/json'
};
var body = {'name':'Michael'};
final response =
client.post(sessionBuilder, '/users', body, headers);
expect(response.body['id'], isA<String>);
expect(response.status, equals(201));
});
});
The same features and configuration should apply as for the withServerpod helper.
Considerations
A lot of the code in the serverpod_test package will be possible to reuse. The solution should aim to create a solution where the two helpers withServerpod and withRelic share as much code as possible.
Activity