An open API service indexing awesome lists of open source software.

https://github.com/neworbit/alsatian-react-testing-library

Helpers for testing React in TypeScript with React Testing Library and Alsatian
https://github.com/neworbit/alsatian-react-testing-library

hacktoberfest

Last synced: about 1 year ago
JSON representation

Helpers for testing React in TypeScript with React Testing Library and Alsatian

Awesome Lists containing this project

README

          

# alsatian-react-testing-library

This package provides helpers for testing React components in Typescript with React Testing Library and Alsatian.

## Installation

```cmd
npm i alsatian-react-testing-library
```

## Usage

```tsx
import { Test, TestFixture } from "alsatian";
import { ExpectElement } from "alsatian-react-testing-library";
import { render } from "@testing-library/react";

import { MyComponent } from "./MyComponent";

configureJSDOM(); // This is important!

@TestFixture("MyComponent")
export class MyComponentTests {

@Test("should render component")
public shouldRenderComponent() {

const wrapper = render();

ExpectElement(wrapper).toMatchElement(


My components body.

);
}

}
```

## License

Made with :sparkling_heart: by [NewOrbit](https://www.neworbit.co.uk/) in Oxfordshire, and licensed under the [MIT Licence](LICENSE)