Rollup and Vite plugin for power-assert, providing descriptive assertion messages through the standard Node.js assert interface. Current stable version is 0.2.0. It transforms assertion expressions (e.g., assert(ary.indexOf(zero) === two)) into detailed, labeled output showing intermediate values. The library supports both Rollup and Vite/Vitest with minimal configuration, and is part of the power-assert monorepo. Key differentiators include zero API overhead and compatibility with Vitest's assert API.
npm install rollup-plugin-power-assertVerified import paths — ran on the pinned version, not inferred.
Configure Vite/Vitest with the powerAssert plugin to enable descriptive assertion messages in test files.
Use Node.js assert module or Vitest's assert API. For other libraries, consider alternative power-assert wrappers.
Install the peer dependency: npm install --save-dev @power-assert/runtime
Monitor the repository for deprecation notices and plan migration to alternative assertion enhancement tools.
npm install --save-dev @power-assert/runtime
Change to: import { powerAssert } from 'rollup-plugin-power-assert'Ensure the file path matches the include glob pattern in the plugin options.