File tree Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Expand file tree Collapse file tree 3 files changed +9
-12
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
-
6
1
## 5.4.5
7
2
8
3
* Ignore "must_be_immutable" warning in generated files. Mocks cannot be made
26
21
27
22
## 5.4.3
28
23
29
- * Require analyzer 5.12.0, allow analyzer version 6.x.
24
+ * Require analyzer 5.12.0, allow analyzer version 6.x;
30
25
* Add example of writing a class to mock function objects.
31
- * Add support for the ` build_extensions ` build.yaml option.
26
+ * Add support for the ` build_extensions ` build.yaml option
32
27
* Require Dart >=3.1.0.
33
28
* ** Potentially breaking** Changed default ` String ` value returned by nice
34
29
mocks' unstubbed method to include some useful info. This could break the
Original file line number Diff line number Diff line change @@ -141,9 +141,11 @@ class MockBuilder implements Builder {
141
141
orderDirectives: true ,
142
142
useNullSafetySyntax: sourceLibIsNonNullable);
143
143
final rawOutput = mockLibrary.accept (emitter).toString ();
144
-
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.
145
147
final mockLibraryContent =
146
- DartFormatter (languageVersion: entryLib.languageVersion.effective )
148
+ DartFormatter (languageVersion: DartFormatter .latestLanguageVersion )
147
149
.format ('''
148
150
// Mocks generated by Mockito $packageVersion from annotations
149
151
// in ${entryLib .definingCompilationUnit .source .uri .path }.
@@ -193,7 +195,7 @@ $rawOutput
193
195
interface .typeArguments.forEach (addTypesFrom);
194
196
interface .allSupertypes.forEach (addTypesFrom);
195
197
case final analyzer.RecordType record:
196
- record.positionalFields. map ((e) => e.type) .forEach (addTypesFrom);
198
+ record.positionalTypes .forEach (addTypesFrom);
197
199
record.namedFields.map ((e) => e.type).forEach (addTypesFrom);
198
200
}
199
201
}
Original file line number Diff line number Diff line change 1
1
name : mockito
2
- version : 5.4.6
2
+ version : 5.4.5
3
3
description : >-
4
4
A mock framework inspired by Mockito with APIs for Fakes, Mocks,
5
5
behavior verification, and stubbing.
@@ -30,5 +30,5 @@ dev_dependencies:
30
30
build_web_compilers : ^4.0.11
31
31
http : ^1.0.0
32
32
lints : ^5.1.0
33
- package_config : ^2.1.1
33
+ package_config : ^2.1.0
34
34
test : ^1.24.4
You can’t perform that action at this time.
0 commit comments