tree: 4faff0975c5102a2feca3744f7797b66dd4be4ea
  1. example/
  2. lib/
  3. test/
  4. build.yaml
  5. CHANGELOG.md
  6. LICENSE
  7. mono_pkg.yaml
  8. pubspec.yaml
  9. README.md
pkgs/checks_codegen/README.md

pub package package publisher

package:checks_code is a companion to package:checks for generating extensions to read fields from subjects under test.

package:checks_codegen (experimental)

package:checks is still experimental. For production use cases, please use package:test and package:matcher.

For packages in the labs.dart.dev publisher we generally plan to either graduate the package into a supported publisher (dart.dev, tools.dart.dev) after a period of feedback and iteration, or discontinue the package. These packages have a much higher expected rate of API and breaking changes.

To provide feedback on the API, please file an issue with questions, suggestions, feature requests, or general feedback.

Quickstart

  1. Add a dev_dependency on checks_codegen (dart pub add dev:checks_codegen).

  2. In a test some_test.dart add an import to some_test.checks.dart annotated with @CheckExtensions([TypesUnderTest]).

  3. Use checks that read fields in your test code:

@CheckExtensions([TypedData])
import 'some_test.checks.dart';

// The `elementSizeInBytes` and `lengthInBytes` extensions are generated.
void main() {
  test('sample test', () {
    check(typedData)
        ..elementSizeInBytes.equals(expectedElementSize)
        ..lengthInBytes.equals(expectedLength);
  });
}