preact-jsx-chai-match-template
A method that adds assertions with html-looks-like to Chai for testing Preact components.
Installation
-
Download the module
npm install preact-jsx-chai-match-template --save-dev
-
Add it to Chai
import chai from 'chai'import assertMatch from 'preact-jsx-chai-match-template'chai
Usage
const component = <div ="container"> <button ="button">Previous</button> <div ="article"> <h1>Hello world</h1> <p>This is a test</p> </div> <button ="button">Next</button> </div> const template = <div ="container"> ... <div ="article"> <h1>Hello world</h1> ... </div> ... </div> to