source_gen_test 1.1.0 copy "source_gen_test: ^1.1.0" to clipboard
source_gen_test: ^1.1.0 copied to clipboard

Test support for the source_gen package. Includes helpers to make it easy to validate both success and failure cases.

example/example.dart

import 'dart:async';

import 'package:source_gen_test/src/build_log_tracking.dart';
import 'package:source_gen_test/src/init_library_reader.dart';
import 'package:source_gen_test/src/test_annotated_classes.dart';

import 'example_generator.dart';
import 'src/example_annotation.dart';

Future<void> main() async {
  final reader = await initializeLibraryReaderForDirectory(
    'example/src',
    'example_test_src.dart',
  );

  initializeBuildLogTracking();
  testAnnotatedElements<ExampleAnnotation>(
    reader,
    const ExampleGenerator(),
    additionalGenerators: const {
      'no-prefix-required': ExampleGenerator(requireTestClassPrefix: false),
    },
  );
}
13
likes
160
pub points
73%
popularity

Publisher

verified publisherkevmoo.com

Test support for the source_gen package. Includes helpers to make it easy to validate both success and failure cases.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, build, build_test, dart_style, meta, path, source_gen, test

More

Packages that depend on source_gen_test