diff --git a/lib/src/builder.dart b/lib/src/builder.dart index 3aa2d536..db94c49a 100644 --- a/lib/src/builder.dart +++ b/lib/src/builder.dart @@ -1270,9 +1270,7 @@ class _MockClassInfo { '/// See the documentation for Mockito\'s code generation ' 'for more information.', ); - if (classIsImmutable) { - cBuilder.docs.add('// ignore: must_be_immutable'); - } + // For each type parameter on [classToMock], the Mock class needs a type // parameter with same type variables, and a mirrored type argument for // the "implements" clause. diff --git a/test/builder/auto_mocks_test.dart b/test/builder/auto_mocks_test.dart index de82ffec..88bf5baa 100644 --- a/test/builder/auto_mocks_test.dart +++ b/test/builder/auto_mocks_test.dart @@ -3784,20 +3784,6 @@ void main() { ); }); - test('adds ignore: must_be_immutable analyzer comment if mocked class is ' - 'immutable', () async { - await expectSingleNonNullableOutput( - dedent(r''' - import 'package:meta/meta.dart'; - @immutable - class Foo { - void foo(); - } - '''), - _containsAllOf('// ignore: must_be_immutable\nclass MockFoo'), - ); - }); - group('typedef mocks', () { group('are generated properly', () { test('when aliased type parameters are instantiated', () async {