-
Notifications
You must be signed in to change notification settings - Fork 220
Language Dart
kazk edited this page Jun 16, 2020
·
3 revisions
- 2.8
Tests are written just like how you'd write outside of Codewars.
The solution belongs to a package named solution
. So it can be imported from package:solution/solution.dart
and the optional preloaded code provided by the kata author can be imported from package:solution/preloaded.dart
.
Example:
int add(int a, int b) {
return a + b;
}
import "package:test/test.dart";
import "package:solution/solution.dart";
void main() {
group("Example", () {
test("add", () {
expect(add(1, 1), equals(2));
});
});
}
See test
's documentation for how to write tests.
12 seconds
None
None