preact-cli-power-assert
Plugin for ⚛️ preact-cli to use power-assert assertions.
Getting Started
Install it with npm:
npm i -D preact-cli-power-assert
or with yarn:
yarn add preact-cli-power-assert --dev
This will also install:
And include in your project by creating or adding to preact.config.js
.
{ // Will run only in test environment via process.env.NODE_ENV check config env;}
Example
Write your assertions as usual, assert API is converted to power-assert by Babel.
; { ; assert; assert; return a + b;}
Related
See also preact-cli-unassert.
Thanks
Many thanks to Jason Miller for creating ⚛️ Preact, much of the related ecosystem and lots of useful stuff.
Heavily inspired by preact-cli-lodash from Sara Vieira.