OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

PRBTest

PRBTest is a Solidity library of testing assertions and logging utilities for smart-contract test suites. Designed for Solidity 0.8.0 and later, it is intended for Foundry and is also documented for Hardhat.

Independent OpenViST project profile, based on linked sources.

PRBTest — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use PRBTest when Solidity tests need reusable, typed assertions or logging, particularly in a Foundry project; the project also documents Hardhat use.

Who it is for

  • Solidity developers building smart-contract test suites.
  • Foundry users who want reusable assertions and logging in test contracts.
  • Hardhat users seeking Solidity testing assertions.

Documented uses

  • Assert equality, inequality, approximate equality, numeric comparisons, boolean conditions and collection membership in Solidity tests.
  • Provide custom error messages for assertions.
  • Emit logs and access a pre-instantiated Foundry cheatcode environment from an inheriting test contract.
Before you choose

Requirements & limits

  • Designed for Solidity 0.8.0 and later.
  • Foundry is the intended environment, while the README also says it can be used with Hardhat.
  • The README recommends Node.js package-manager installation and documents Foundry remapping configuration.
  • PRBTest can be combined with Forge Std utilities except for its Test contract.
  • The repository identifies the license as MIT.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install PRBTest with a Node.js package manager for Foundry

Add PRBTest to a project and configure Foundry to resolve its package import.

Before you start

  • A Node.js package manager.
  • A Foundry project if using the documented Foundry remapping.

Steps

  1. Install the package with a package manager; the README gives bun add @prb/test as an example.

  2. For Foundry, add @prb/test/=node_modules/@prb/test/src/ to remappings.txt.

Expected outcome

The package and Foundry remapping are configured as described in the README.

Guide limitations

  • The README also documents a Git submodule method but says it is not recommended.
  • This covers installation and import resolution, not running or validating a test suite.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
12 October 2026
Original website title
PaulRBerg/prb-test · Official homepage title · retained in its source language

Related options

DSTest — PRBTest describes itself as a replacement for DSTest and cites added assertions, including array equality and inequality checks.

Forge Std — PRBTest is complementary to Forge Std testing utilities, except for Forge Std's Test contract.