anchor.diff:  void main() {
     group('non-classes', () {
       test('const field', () async {
  -      var element = await _getClassForCodeString('theAnswer');
  -
  -      expect(
  -          _generator.generate(element, null),
  +      expect(
  +          _runForElementNamed('theAnswer'),
             throwsInvalidGenerationSourceError(
                 'Generator cannot target `const dynamic theAnswer`.',
                 'Remove the JsonSerializable annotation from `const dynamic theAnswer`.'));
       });
   
       test('method', () async {
  -      var element = await _getClassForCodeString('annotatedMethod');
  -
  -      expect(
  -          _generator.generate(element, null),
  +      expect(
  +          _runForElementNamed('annotatedMethod'),
             throwsInvalidGenerationSourceError(
                 'Generator cannot target `annotatedMethod`.',
                 'Remove the JsonSerializable annotation from `annotatedMethod`.'));
       });
     });
  -
     group('unknown types', () {
       test('in constructor arguments', () async {
  -      var element = await _getClassForCodeString('UnknownCtorParamType');
  -
  -      expect(
  -          _generator.generate(element, null),
  +      expect(
  +          _runForElementNamed('UnknownCtorParamType'),
             throwsInvalidGenerationSourceError(
                 'At least one constructor argument has an invalid type: `number`.',
                 'Check names and imports.'));
       });
   
       test('in fields', () async {
  -      var element = await _getClassForCodeString('UnknownFieldType');
  -
  -      expect(
  -          _generator.generate(element, null),
  +      expect(
  +          _runForElementNamed('UnknownFieldType'),
             throwsInvalidGenerationSourceError(
                 'At least one field has an invalid type: `number`.',
                 'Check names and imports.'));
  
positive.code: import 'dart:async';
  
  import 'package:analyzer/dart/ast/ast.dart';
  import 'package:analyzer/dart/element/element.dart';
  import 'package:analyzer/src/string_source.dart';
  import 'package:json_serializable/json_serializable.dart';
  import 'package:path/path.dart' as p;
  
negative.code:   });
  
    test('reads JsonKey annotations', () async {
      var output = await _runForElementNamed('Person');
  
      expect(output, contains("'h': height,"));
      expect(output, contains("..height = json['h']"));
  