Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jonathanconway/exercise-discount-ascii-warehouse-react-jest

A small demo app to show how to use ReactJS with Jasmine tests and Jest mocking.
https://github.com/jonathanconway/exercise-discount-ascii-warehouse-react-jest

Last synced: 15 days ago
JSON representation

A small demo app to show how to use ReactJS with Jasmine tests and Jest mocking.

Awesome Lists containing this project

README

        

# Discount ASCII Warehouse with ReactJS and Jest

This is a demo app, intended as a guide to writing simple apps using ReactJS, unit tested with Jasmine, and with Jest as the mocking tool.

## Requirements

This solution requires the following global dependencies to be installed:

* NodeJS v0.10.0 ([download](https://nodejs.org/dist/v0.10.0/))
(Unfortunately, it only works with this older version, due to Jest. This is an [open issue on GitHub](https://github.com/facebook/jest/issues/243).)
* Gulp (`npm install -g gulp`)
* Jest (`npm install -g jest-cli`)

If you have a later version of Node installed, you can still install v0.10 and run them both side-by-side. Simply install the [`n`](https://www.npmjs.com/package/n) package, and use it to install v0.10.0 and switch to v0.10.0. You can always install your newer version as well, and then switch between whichever versions you have installed.

## Installation

After installing the global dependencies, run the following:

`$ npm install`

And then run the solution (launches Grunt, which then spawns NodeJS to serve the files):

`$ npm start`

To run the Jasmine/Jest tests:

`$ npm test`

## License

Apache 2 Copyright © 2015 Jonathan Conway