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

https://github.com/konojunya/react-testing-with-ava

Testing React Component with ava
https://github.com/konojunya/react-testing-with-ava

Last synced: 17 days ago
JSON representation

Testing React Component with ava

Awesome Lists containing this project

README

        

# React Testing with ava

![](https://raw.githubusercontent.com/avajs/ava/master/media/header.png)

React component test code

# use

```
$ npm install
$ npm test
```

## develop

```
$ npm start
```

# screen shot

![](https://raw.githubusercontent.com/konojunya/react-testing/master/screenshots/testing.png)

# component

`src/component/App.jsx`

```
import React from "react"

export default class App extends React.Component {

render() {
return(

hello world


)
}

}
```

# test pattern

- can use ava
- rendered h1 element
- render hello world
- has a .title class name

---

- まずavaが使える状態であるか
- h1要素でレンダリングされているか
- hello worldという文字がレンダリングされているか
- titleというクラス名がついているか

# reference

- [avajs/ava README](https://github.com/avajs/ava)
- [avajs/ava Testing React components](https://github.com/avajs/ava/blob/master/docs/recipes/react.md)
- [JavaScriptのテストフレームワークはAVAが流行り気味らしいので調べてみた](http://qiita.com/niisan-tokyo/items/000db7cd0e995c802334)
- [airbnb/enzyme](https://github.com/airbnb/enzyme)