crank-testing-library

0.0.1 • Public • Published

Crank Testing Library


Simple Crank.js testing utilities that encourage good testing practices.

Crank Testing Library is a lightweight adapter built on top of DOM Testing Library.


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

[MIT][license]

Readme

Keywords

none

Package Sidebar

Install

npm i crank-testing-library

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

6.05 kB

Total Files

4

Last publish

Collaborators

  • ryhinchey