nwb
Version:
A toolkit for React, Preact & Inferno apps, React libraries and other npm modules for the web, with no configuration (until you need it)
24 lines (18 loc) • 478 B
JavaScript
import expect from 'expect'
import React from 'react'
import {render, unmountComponentAtNode} from 'react-dom'
import Component from 'src/'
describe('Component', () => {
let node
beforeEach(() => {
node = document.createElement('div')
})
afterEach(() => {
unmountComponentAtNode(node)
})
it('displays a welcome message', () => {
render(<Component/>, node, () => {
expect(node.innerHTML).toContain('Welcome to React components')
})
})
})