Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/watson28/react-testing-example

Project to demostrate how to test React components
https://github.com/watson28/react-testing-example

javascript karma mochajs reactjs

Last synced: 11 days ago
JSON representation

Project to demostrate how to test React components

Awesome Lists containing this project

README

        

# React Testing Examples
project with examples on how to create unit test for React components.

## Uses with Docker

### installation
go into folder project and run

```
docker build -t react-example .
```

### Running application
```
docker run --rm -p 8080:8080 -v $(pwd):/workspace react-example
```

### Running tests
Tests are configured to run with karma and Headless Chrome.
```
docker run --rm -p 8080:8080 -v $(pwd):/workspace react-example npm test
```

## Uses without Docker

### installation
nodejs and npm is required

### Running application
```
npm start
```

### Running tests
Running the chrome binary might fail on some systems. That's why is recommended to use the docker image.
```
npm test
```