Sanitize React components using styled-jsx
$ yarn add --dev sanitize-styled-jsx
// Testing with Jest
import React from 'react'
import assertEqualJSX from 'assert-equal-jsx'
import Component from '../src/index'
import sanitize from 'sanitize-styled-jsx'
describe('component', () => {
it('should create a correct DOM structure', () => {
const componentMock = <h1>Hello Bu!</h1>
assertEqualJSX(<Component name="Bu" />, componentMock, { sanitize })
})
})
Type: string
Required
String to be sanitized
MIT © Bu Kinoshita