jamiebuilds / Assert Equal Jsx
Licence: mit
assertEqualJSX
Stars: ✭ 81
Programming Languages
javascript
184084 projects - #8 most used programming language
assertEqualJSX
API
assertEqualJSX(jsx, jsx, [opts]);
Example
assertEqualJSX(
<MyComponent/>,
// should equal:
<div className="my-component">
<h1>Hello world</h1>
<p>Look at this amazing component</p>
</div>
)
opts.sanitize
function sanitizeId(str) {
return str.replace(/my-component-id-(\d+)/ig, 'my-component-id-0');
}
assertEqualJSX(
<div id="my-component-id-314159265"/>,
// should equal:
<div id="my-component-id-0">,
// with sanitization:
{
sanitize: sanitizeId
}
)
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].