The Wayback Machine - https://web.archive.org/web/20201102192444/https://github.com/ryhinchey/crank-testing-library
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Crank Testing Library

Build Status

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 

Usage

  // 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();
});

About

Simple Crank.js testing utilities that encourage good testing practices

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.