Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const component = ({name}, cmp) => {
instance1 = cmp
pass('render function called')
return (<div>{name}</div>)
}
const options = {
componentWillMount: (props, refs, cmp) => {
instance2 = cmp
pass('componentWillMount called')
}
}
const Component = functional(component, options)
const rendered = render()
const {type, props:{children}} = rendered
{
const actual = type
const expected = 'div'
is(actual, expected, 'div element rendered')
}
{
const actual = children
const expected = 'test'
is(actual, expected, 'prop passed through')
}
{
const actual = instance1