source_gen_test 1.0.6 copy "source_gen_test: ^1.0.6" to clipboard
source_gen_test: ^1.0.6 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),
    },
  );
}
11
likes
140
pub points
68%
popularity

Publisher

verified publisherj832.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