Skip to content

Commit fb99e20

Browse files
committed
fix: test using matcher
1 parent e601380 commit fb99e20

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ dev_dependencies:
2929
flutter_lints: ^2.0.2
3030
flutter_test:
3131
sdk: flutter
32+
matcher: ^0.12.17
3233

3334
# For information on the generic Dart part of this file, see the
3435
# following page: https://dart.dev/tools/pub/pubspec

test/twilio_voice_test.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/services.dart';
22
import 'package:flutter_test/flutter_test.dart';
3+
import 'package:matcher/matcher.dart' as matcher;
34

45
void main() {
56
const MethodChannel channel = MethodChannel('twilio_voice');
@@ -14,6 +15,7 @@ void main() {
1415
});
1516

1617
test("Mock Test", () async {
17-
expect(await channel.invokeMethod("42"), equals("42"));
18+
final result = await channel.invokeMethod("42");
19+
expect(result, matcher.equals("42"));
1820
});
1921
}

0 commit comments

Comments
 (0)