Skip to content
pubscout

glados

1.1.7, released 3 years ago by an unverified publisher

A property-based testing framework for Dart and Flutter.

WASM-ready
$ flutter pub add glados
Source repository

What it does

Glados runs tests by generating a wide variety of random inputs to break defined properties and simplifies failing inputs into concise error reports.

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

Use it when

  • You want to test code against a wide variety of automatically generated inputs.
  • You want to write properties that should always hold true instead of concrete examples.

Skip it when

  • You only want to write traditional unit tests with concrete inputs.

Strengths

  • Writes fewer tests while testing a wide variety of inputs.
  • Concise error reports that shrink failing inputs.
  • Easily customizable input generators for custom data classes.

Weaknesses

  • Requires shifting mindset to property-based thinking rather than traditional examples.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
3

Add to dev_dependencies alongside package:test.

Glados<int>().test('number is less than 42', (a) {
  expect(a * 2, lessThan(42));
});

Alternatives

Packages that do the same job and could replace glados.

  • mocktail

    If you need mocking and stubbing capabilities instead of property-based testing.

Works with

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