Closed Sgoettschkes closed 8 years ago
The documentation is located on gh-pages
branch.
https://help.github.com/articles/what-are-github-pages/
The corrected unittest code is following
library services;
import 'package:redstone/redstone.dart' as app;
@app.Route("/user/:username")
helloUser(String username) => "hello, $username";
import 'package:test/test.dart';
import 'package:redstone/redstone.dart' as app;
import 'package:your_package_name/services.dart';
main() {
// Load handlers in 'services' library
setUp(() => app.redstoneSetUp([#services]));
// Remove all loaded handlers
tearDown(() => app.redstoneTearDown());
test("hello service", () {
// Create a mock request
var req = new app.MockRequest("/user/luiz");
// Dispatch the request
return app.dispatch(req).then((resp) {
// Verify the response
expect(resp.statusCode, equals(200));
expect(resp.mockContent, equals("hello, luiz"));
});
});
}
@Pacane this issue could be closed.
@sestegra did you fix it? If so I'll close the issue. Otherwise, I'll fix it.
@Pacane done with #179
Thanks!
I was trying to get the example for Unit test working and had several issues:
import 'package:redstone/mocks.dart';
does not work. It has to beimport 'package:redstone/request_mock.dart';
I didn't find the source code for the documentation. If it's open source, I'd like to contribute!