Search categories, packages and repositories

Package detailsv1.33.0

test

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

AndroidiOSWebmacOSWindowsLinux
30-day downloads
14.1M
Likes
629
Pub points
150

Install package

flutter pub add test

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The test package is a comprehensive library for writing and running Dart tests across multiple platforms, including Android, iOS, Web, macOS, Windows, and Linux. It provides a rich set of tools for unit, integration, and widget testing, supporting asynchronous testing, mocking, and test reporting. Built by dart.dev, it integrates seamlessly with Flutter and Dart tooling, enabling developers to maintain high code quality through automated testing workflows.

Use cases

  • Unit testing Dart code
  • Integration testing Flutter apps
  • Widget testing in Flutter
  • Cross-platform test execution
  • Automated CI/CD testing
  • Mocking dependencies in tests

Key features

  • Supports async and await testing
  • Built-in matchers and expectations
  • Test isolation and setup/teardown
  • Mocking framework integration
  • Detailed test reporting
  • Cross-platform compatibility

Suitable for

  • Flutter developers
  • Dart library authors
  • CI/CD pipeline integrators
  • Teams practicing test-driven development
  • QA engineers automating test suites

Considerations

  • Requires understanding of Dart testing conventions
  • May need additional packages for complex mocks
  • Test setup can become complex in large projects
  • Not intended for end-user testing scenarios
  • Limited GUI for test execution

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Dart CI OpenSSF Scorecard

What's here?

Welcome! package:test is the standard testing library for Dart and Flutter. If you have questions about Dart testing, please see the docs for package:test. package:test_api and package:test_core are implementation details and generally not user-facing.

package:checks is a relatively new library for expressing test expectations. It's a more modern version of package:matcher and features a literate API.

Packages

Package Description Issues Version
checks A framework for checking values against expectations and building custom expectations. issues pub package
fake_async Fake asynchronous events such as timers and microtasks for deterministic testing. issues pub package
matcher Support for specifying test expectations via an extensible Matcher class. Also includes a number of built-in Matcher implementations for common cases. issues pub package
test A full featured library for writing and running Dart tests across platforms. issues pub package
test_api The user facing API for structuring Dart tests and checking expectations. pub package
test_core A basic library for writing tests and running them on the VM. pub package
test_descriptor An API for defining and verifying files and directory structures. issues pub package
test_process Test processes: starting; validating stdout and stderr; checking exit code. issues pub package

Categories

Dependencies

Dependency list 25 items

Source repository

Projects using this package