felangel / mocktail

A mock library for Dart inspired by mockito
https://pub.dev/packages/mocktail
MIT License
617 stars 81 forks source link

Support latest analyzer #128

Closed imtoori closed 2 years ago

imtoori commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

I'm trying to use the latest version of freezed but since it depends on analyzer >= 3.0.0 it's not compatible with mocktail 0.3.0

I'm not completely sure this is correct, but I'm posting the logs.

Logs

Because test >=1.16.0-nullsafety.19 <1.16.6 depends on test_api 0.2.19 and test >=1.16.6 <1.17.10 depends on analyzer ^1.0.0, test >=1.16.0-nullsafety.19 <1.17.10 requires test_api 0.2.19 or analyzer ^1.0.0.
And because test >=1.17.10 <1.20.0 depends on analyzer >=1.0.0 <3.0.0, test >=1.16.0-nullsafety.19 <1.20.0 requires test_api 0.2.19 or analyzer >=1.0.0 <3.0.0.
And because test >=1.20.0 depends on test_api 0.4.9 and every version of flutter_test from sdk depends on test_api 0.4.8, if flutter_test from sdk and test >=1.16.0-nullsafety.19 then analyzer >=1.0.0 <3.0.0.
And because mocktail 0.3.0 depends on test ^1.16.0 and no versions of mocktail match >0.3.0 <0.4.0, if flutter_test from sdk and mocktail ^0.3.0 then analyzer >=1.0.0 <3.0.0.
And because stream_chat_flutter_core depends on freezed ^2.0.0 which depends on analyzer >=3.0.0 <5.0.0, flutter_test from sdk is incompatible with mocktail ^0.3.0.
So, because stream_chat_flutter_core depends on both mocktail ^0.3.0 and flutter_test from sdk, version solving failed.

Paste the output of running flutter doctor -v here.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.5, on macOS 12.2.1 21D62 darwin-arm, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.66.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!
PawlikMichalMiquido commented 2 years ago

If anyone would be looking for a temporary workaround then you might try adding:

dependency_overrides:
  test_api: 0.4.9
felangel commented 2 years ago

Hi @imtoori @MichalBaranMiquido @jonasfranz @jenshor 👋 Thanks for opening an issue!

Can you please share your pubspec.yaml? I'm not able to reproduce the issue on the latest stable version of Flutter (3.0.0).

renancaraujo commented 2 years ago

Also tried to reproduce it here in the latest version. Have you tried to run pub upgrade <deps> on test to update your lock?

PawlikMichalMiquido commented 2 years ago

It also stopped happening in my project after updating to Flutter 3.0 ✅

imtoori commented 2 years ago

I can confirm it's working fine on flutter 3