reblend-testing-library
Version:
Simple and complete Reblendjs testing utilities that encourage good testing practices.
13 lines (12 loc) • 468 B
JavaScript
import { Reblend } from 'reblendjs';
import { getByText, render, screen } from '../';
// This just verifies that by importing RTL in an
// environment which supports afterEach (like jest)
// we'll get automatic cleanup between tests.
test('first', async () => {
await render(Reblend.construct.bind(this)("div", null, "hi"));
expect(screen.getByText('hi').textContent).toBe('hi');
});
test('second', async () => {
expect(document.body).toBeEmptyDOMElement();
});