Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: failing tests due to Flutter upgrade to version 3.27. #812

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/melos/lib/src/command_configs/bootstrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class BootstrapCommandConfigs {
? LifecycleHooks.fromYaml(hooksMap, workspacePath: workspacePath)
: LifecycleHooks.empty;

// ignore: dead_null_aware_expression
final environment = bootstrapConstraints.environment ?? {};
final dependencies = bootstrapConstraints.dependencies;
final devDependencies = bootstrapConstraints.devDependencies;
Expand Down
8 changes: 4 additions & 4 deletions packages/melos/test/commands/bootstrap_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ dependency_overrides:
updatedPubspecOverrides: '''
# melos_managed_dependency_overrides: a
dependency_overrides:
x: any
a:
path: ../a
x: any
''',
);
});
Expand Down Expand Up @@ -858,7 +858,7 @@ Generating IntelliJ IDE files...
equals(defaultTestEnvironment),
);
expect(
pubspecA.environment?['sdk'],
pubspecA.environment['sdk'],
equals(VersionConstraint.parse('>=2.18.0 <3.0.0')),
);
expect(
Expand All @@ -883,11 +883,11 @@ Generating IntelliJ IDE files...
);

expect(
pubspecBPreBootstrap.environment?['flutter'],
pubspecBPreBootstrap.environment['flutter'],
equals(VersionConstraint.parse('>=2.12.0 <3.0.0')),
);
expect(
pubspecB.environment?['flutter'],
pubspecB.environment['flutter'],
equals(VersionConstraint.parse('>=2.18.0 <3.0.0')),
);
expect(
Expand Down
2 changes: 2 additions & 0 deletions packages/melos/test/matchers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Matcher ignoringDependencyMessages(String expected) {
!line.startsWith('Got dependencies!') &&
// Removes lines like " pub_updater 0.4.0 (0.5.0 available)"
!(line.startsWith(' ') && line.contains(' available)')) &&
!line.startsWith('No dependencies would change in') &&
!line.startsWith('Would change') &&
!line.contains(
'newer versions incompatible with dependency constraints',
) &&
Expand Down
2 changes: 1 addition & 1 deletion packages/melos/test/pubspec_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ extension PubspecExtension on Pubspec {
screenshots?.map((screenshot) => screenshot.toJson()).toList(),
'documentation': documentation,
'environment':
environment?.map((key, value) => MapEntry(key, value?.toString())),
environment.map((key, value) => MapEntry(key, value?.toString())),
'dependencies':
dependencies.map((key, value) => MapEntry(key, value.toJson())),
'dev_dependencies':
Expand Down
3 changes: 1 addition & 2 deletions packages/melos/test/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ Future<Directory> createProject(
String? path,
bool createLockfile = false,
}) async {
final pubspec = partialPubspec.environment != null &&
partialPubspec.environment!.isNotEmpty
final pubspec = partialPubspec.environment.isNotEmpty
? partialPubspec
: partialPubspec.copyWith(
environment: {
Expand Down
Loading