File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 1+ ## 5.4.6
2+
3+ * When formatting a generated mocks library, use the language version of the
4+ library with the mockito annotation.
5+
16## 5.4.5
27
38* Ignore "must_be_immutable" warning in generated files. Mocks cannot be made
Original file line number Diff line number Diff line change @@ -141,11 +141,9 @@ class MockBuilder implements Builder {
141141 orderDirectives: true ,
142142 useNullSafetySyntax: sourceLibIsNonNullable);
143143 final rawOutput = mockLibrary.accept (emitter).toString ();
144- // The source lib may be pre-null-safety because of an explicit opt-out
145- // (`// @dart=2.9`), as opposed to living in a pre-null-safety package. To
146- // allow for this situation, we must also add an opt-out comment here.
144+
147145 final mockLibraryContent =
148- DartFormatter (languageVersion: DartFormatter .latestLanguageVersion )
146+ DartFormatter (languageVersion: entryLib.languageVersion.effective )
149147 .format ('''
150148// Mocks generated by Mockito $packageVersion from annotations
151149// in ${entryLib .definingCompilationUnit .source .uri .path }.
@@ -195,7 +193,7 @@ $rawOutput
195193 interface .typeArguments.forEach (addTypesFrom);
196194 interface .allSupertypes.forEach (addTypesFrom);
197195 case final analyzer.RecordType record:
198- record.positionalTypes .forEach (addTypesFrom);
196+ record.positionalFields. map ((e) => e.type) .forEach (addTypesFrom);
199197 record.namedFields.map ((e) => e.type).forEach (addTypesFrom);
200198 }
201199 }
Original file line number Diff line number Diff line change 1- const packageVersion = '5.4.5 ' ;
1+ const packageVersion = '5.4.6 ' ;
Original file line number Diff line number Diff line change 11name : mockito
2- version : 5.4.5
2+ version : 5.4.6
33description : >-
44 A mock framework inspired by Mockito with APIs for Fakes, Mocks,
55 behavior verification, and stubbing.
@@ -30,5 +30,5 @@ dev_dependencies:
3030 build_web_compilers : ^4.0.11
3131 http : ^1.0.0
3232 lints : ^5.1.0
33- package_config : ^2.1.0
33+ package_config : ^2.1.1
3434 test : ^1.24.4
You can’t perform that action at this time.
0 commit comments