source_gen_test

Creator: coderz1093

Last updated:

0 purchases

source_gen_test Image
source_gen_test Images

Languages

Categories

Add to Cart

Description:

source gen test

Make it easy to test Generators derived from package:source_gen by
annotating test files.
@ShouldGenerate(
r'''
const TestClass1NameLength = 10;

const TestClass1NameLowerCase = 'testclass1';
''',
configurations: ['default', 'no-prefix-required'],
)
@ShouldThrow(
'Uh...',
configurations: ['vague'],
element: false,
)
@TestAnnotation()
class TestClass1 {}
copied to clipboard
Test against a golden output file if you also want to write tests on the output itself.
part 'goldens/testclass2.dart';

@ShouldGenerateFile(
'goldens/testclass2.dart',
partOfCurrent: true,
configurations: ['default', 'no-prefix-required'],
)
@ShouldThrow(
'Uh...',
configurations: ['vague'],
element: false,
)
@TestAnnotation()
class TestClass2 {}
copied to clipboard
Other helpers are also provided.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.