talira

build_verify

Test that generated Dart code is up to date

open sourceMITfree

build_verify is a Dart test utility that checks a package's generated code is up to date when it uses build_runner: add one test that calls expectBuildClean, and it fails when running the build would change the files in the git repository, so CI catches generated code someone forgot to regenerate. MIT licensed.

Problems it solves

  • make CI fail when someone forgets to rerun build_runner in my Dart package
  • check that generated Dart code is committed and up to date
  • catch stale json_serializable output in tests

Features

  • expectBuildClean test that fails when build_runner output is stale
  • compares the build's output with the git repository

Alternatives

The same job

These do what build_verify does.

  1. source_gen_test Test Dart code generators built on source_gen by annotating test files

Compare build_verify with the top 3