Skip to content

bukinoshita/sanitize-styled-jsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sanitize-styled-jsx Build Status

Sanitize React components using styled-jsx

Install

$ yarn add --dev sanitize-styled-jsx

Usage

// 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 })
  })
})

API

sanitize(input)

input

Type: string
Required

String to be sanitized

License

MIT © Bu Kinoshita