yhtml5-test
Version:
A test framework for front-end projects
21 lines (17 loc) • 591 B
JavaScript
import React from 'react'
import ReactDOM from 'react-dom';
const rendersWithoutCrashing = (name = '', Component) => {
if (Object.prototype.toString.call(name) !== '[object String]' &&
Object.prototype.toString.call(name) !== '[object Function]') {
throw 'The function rendersWithoutCrashing receives [name:string, Component:function] as arguments'
}
it(`${name} renders without crashing`, () => {
const div = document.createElement('div')
ReactDOM.render(<Component />, div)
})
}
const smokeIsolated = {}
const smokeDeep = {}
export {
rendersWithoutCrashing,
}