Skip to content

Commit

Permalink
Don't use deprecated apis in test
Browse files Browse the repository at this point in the history
  • Loading branch information
blaugold committed Dec 11, 2023
1 parent f35278e commit 3a0cfea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ scripts:
run: dart format .

format:check:
run: dart format --set-exit-if-changed . --output=show
run: dart format --set-exit-if-changed . --output=none

analyze:
run: flutter analyze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ void main() {
final eventChannel = EventChannel(channelName);
final methodChannel = MethodChannel(channelName);

test('startSendingUpdates', () async {
testWidgets('startSendingUpdates', (tester) async {
var channelHasStartedListening = false;
methodChannel.setMockMethodCallHandler((call) async {
tester.binding.defaultBinaryMessenger
.setMockMethodCallHandler(methodChannel, (call) async {
channelHasStartedListening = call.method == 'listen';
return null;
});

final firstEvent =
Expand All @@ -24,7 +26,7 @@ void main() {

var firstResult = {'key': 'value'};

unawaited(eventChannel.binaryMessenger.handlePlatformMessage(
unawaited(tester.binding.defaultBinaryMessenger.handlePlatformMessage(
channelName,
eventChannel.codec.encodeSuccessEnvelope(firstResult),
(data) {},
Expand Down

0 comments on commit 3a0cfea

Please sign in to comment.