Skip to content
pubscout

kiri_check

1.4.0, released 4 weeks ago by szktty.jp

Property-based testing library for Dart, integrating with package:test.

WASM-ready
$ flutter pub add kiri_check
Source repository

What it does

It lets you define properties that are automatically tested with random data, supports custom exploration, and offers stateful testing for systems that change over time.

AI-written summary of version 1.4.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Writing property-based tests for Dart code
  • Testing stateful systems like databases or UI state machines
  • Integrating tests into existing package:test suites

Skip it when

  • Replacing unit tests that only check specific inputs
  • Using in projects that require code generation or declarative UI patterns

Strengths

  • Seamless integration with package:test
  • Supports stateful testing
  • Customizable exploration and shrinking
  • Cross-platform support (Android, iOS, web, desktop)

Weaknesses

  • No built-in async support documented
  • Limited to Dart (no Flutter widgets integration)
  • Requires manual setup of stateful behaviors

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
6

Add as dev_dependency and import 'package:kiri_check/kiri_check.dart'; no build_runner needed

import 'package:kiri_check/kiri_check.dart';

void main() {
  property('FizzBuzz', () {
    forAll(integer(min: 0, max: 100), (n) {
      final result = fizzbuzz(n);
      if (n % 15 == 0) {
        expect(result, 'FizzBuzz');
      } else if (n % 3 == 0) {
        expect(result, 'Fizz');
      } else if (n % 5 == 0) {
        expect(result, 'Buzz');
      } else {
        expect(result, n.toString());
      }
    });
  });
}

Alternatives

Packages that do the same job and could replace kiri_check.

Works with

Packages commonly used together with kiri_check: ones it builds on, ones built on it, and its own family.