You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[!] Flutter (Channel stable, 3.10.1, on macOS 13.4.1 22F82 darwin-arm64, locale en-PL)
• Flutter version 3.10.1 on channel stable at /Users/bartosz/fvm/versions/3.10.1
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d3d8effc68 (7 weeks ago), 2023-05-16 17:59:05 -0700
• Engine revision b4fb11214d
• Dart version 3.0.1
• DevTools version 2.23.1
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] IntelliJ IDEA Community Edition (version 2022.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 71.0.6
• Dart plugin version 223.7571.203
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.4.1 22F82 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 114.0.5735.198
[✓] Network resources
• All expected network resources are available.
Dart Version
3.0.1
Steps to Reproduce
About the problem
The main problem I am facing right now is being unable to write a unit test for one of the POST endpoints. It requires passing FormData, but I can't compare FormData to another FormData. This limitation prevents me from writing the unit test, and I encounter the following error:
Assertion failed: "Could not find mocked route matching request
for POST /internal/api/v3/screenshot/push { data: Instance of 'FormData',
query parameters: {}, headers: {content-type: multipart/form-data;
boundary=--dio-boundary-0598433441, accept: application/json,
content-length: 294} }"
Code
Here's the code related to the issue:
@immutable
class CreateScreenshotRequest {
const CreateScreenshotRequest({
required this.createdAt,
required this.screenshotBytes,
});
FormData toFormData() {
return FormData.fromMap({
'created_at': createdAt.toString(),
'screenshot': MultipartFile.fromBytes(
screenshotBytes,
filename: 'name',
),
});
}
final DateTime createdAt;
final Uint8List screenshotBytes;
@override
bool operator ==(Object other) =>
other is CreateScreenshotRequest &&
createdAt == other.createdAt &&
listEquals(screenshotBytes, other.screenshotBytes);
@override
int get hashCode => createdAt.hashCode ^ screenshotBytes.hashCode;
}
Here's how the unit test looks like:
test('No data is returned when HTTP call is successful', () async {
dioAdapter.onPost(
path,
(server) => server.reply(200, ''),
data: createScreenshotRequest.toFormData(),
headers: _getRequestHeaders(),
);
final response = await apiClient.sendScreenshot(
request: createScreenshotRequest,
);
expect(response, isA<Success>());
});
Expected Result
The main problem I am facing right now is being unable to compare FormData objects directly. The Dio library does not provide a built-in comparison method or operator overload for FormData. However, it is important for me to be able to compare one FormData object to another.
Package
dio
Version
5.2.1
Output of
flutter doctor -v
Dart Version
3.0.1
Steps to Reproduce
About the problem
The main problem I am facing right now is being unable to write a unit test for one of the POST endpoints. It requires passing FormData, but I can't compare FormData to another FormData. This limitation prevents me from writing the unit test, and I encounter the following error:
Code
Here's the code related to the issue:
Here's how the unit test looks like:
Expected Result
The main problem I am facing right now is being unable to compare FormData objects directly. The Dio library does not provide a built-in comparison method or operator overload for FormData. However, it is important for me to be able to compare one FormData object to another.
Actual Result
The text was updated successfully, but these errors were encountered: