This is an example of building a React application using a Redux store. The app is fully tested, showing how to use Mocha for unit tests and CasperJS for end to end testing.
Installation instructions:
- Clone this git repository locally and navigate to the folder in your console.
- Install the node dependancies by running
npm install
- Launch the application in dev mode by running
npm run dev
git clone git@github.com:markwylde/react-demo.git
cd react-demo
npm install
npm run dev
Deployment:
- Check your code passes all unit tests by running
npm run unit_tests
- Check your code is well structured and formatted to the correct standards
npm run lint
- Run
npm run build
to compile the source into ./dist. - Check your code passes all feature tests
npm run feature_tests
npm run unit_tests
npm run lint
npm run build
npm run TEST_WEBSERVER="dist" npm run feature_tests
##Testing:# ###Feature Tests## The feature test runner comes with the ability to start a local webserver. When running the tests locally you wil probably want to test the already running webpack-dev-server. So that is the default behaviour of feature_tests.
- If you would like to feature test the build (
dist
) directory you can add theTEST_WEBSERVER
environment variable:
TEST_WEBSERVER="dist" npm run feature_tests
####Locally####
- To run the feature tests locally just run
npm run feature_tests
####BrowserStack####
Make sure you have the BrowserStackLocal service running
- To run the feature tests on browser stack run the following
TEST_BROWSER="browserstack:chrome:osx" BS_USER="???" BS_KEY="???" npm run feature_tests
- The following test browsers are currently available:
browserstack:IE11:windows
browserstack:IE10:windows
browserstack:IE9:windows
browserstack:chrome:osx
browserstack:firefox:osx
browserstack:safari9:osx
browserstack:safari8:osx
browserstack:ios:iphone
browserstack:android:galaxy