Skip to content
pubscout

test

1.33.0, released 6 weeks ago by dart.dev

A full featured library for writing and running Dart tests across platforms.

WASM-readyRock solid
$ flutter pub add test
Source repository

What it does

Provides a standard way of writing and running tests in Dart across multiple platforms like VM, browsers, and node. It supports grouping tests, setting up and tearing down state, sharding, and collecting code coverage.

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

Use it when

  • You need to write unit, widget, or integration tests in Dart or Flutter.
  • You want to run tests across multiple platforms such as Chrome and the Dart VM.
  • You need features like sharding, custom test reporters, or code coverage collection.

Skip it when

  • You are not writing Dart or Flutter code.

Strengths

  • Cross-platform test runner supporting VM, browsers, and more.
  • Rich features including sharding, test concurrency, and randomization.
  • Built-in support for code coverage and multiple output reporters.

Weaknesses

  • Can be complex to configure for advanced browser or hybrid test setups.

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
25

Not documented

import 'package:test/test.dart';

void main() {
  test('String.split() splits the string on the delimiter', () {
    var string = 'foo,bar,baz';
    expect(string.split(','), equals(['foo', 'bar', 'baz']));
  });
}

Alternatives

Packages that do the same job and could replace test.

  • benchmark

    A full featured library for writing and running Dart benchmarks.

  • patrol_log

    Log package for Patrol, a Flutter-native UI testing framework

  • golden_test

    A zero-dependency wrapper for Flutter golden tests with theme, locale, and multi-device support.

  • fluttersdk_dusk

    Flutter E2E test driver for LLM agents and CLI via VM Service extensions without a test harness.

Works with

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