0.0.1 • Published 4 years ago
crank-testing-library v0.0.1
Installation
This module is distributed via npm
and should be installed as one of your
project's devDependencies
:
npm install --save-dev crank-testing-library
A simple example
// Greeting.jsx
/** @jsx createElement */
import {createElement} from "@bikeshaving/crank";
function Greeting({name="World"}) {
return (
<div >Hello {name}</div>
);
}
// GreetingTest.spec.js
/** @jsx createElement */
import {createElement} from "@bikeshaving/crank";
import { render } from 'crank-testing-library';
import Greeting from './';
test('renders name', () => {
const { getByText } = render(<Greeting />);
expect(getByText("Hello World")).toBeTruthy();
});
});
License
0.0.1
4 years ago