From d3627833f2fc09b5388999265a3ab203f54fc750 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Thu, 28 Sep 2017 09:28:22 +0200 Subject: Add testing documentation to README.md --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a4ca63a0..f163e114 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The user-facing component of the OpenDC stack, allowing users to build and inter ## Get Up and Running -*Looking for the full OpenDC stack? Check out [the main OpenDC repo](https://github.com/atlarge-research/opendc) for instructions on how to set up a Docker container with all of OpenDC, without the hassle of running each of the components manually.* +Looking for the full OpenDC stack? Check out [the main OpenDC repo](https://github.com/atlarge-research/opendc) for instructions on how to set up a Docker container with all of OpenDC, without the hassle of running each of the components manually. ### Installation @@ -37,6 +37,7 @@ yarn build **Note:** Perhaps this goes without saying, but for any functionality beyond visiting the entry page, a server backend running in the background is necessary. The easiest way to do this is to have an OpenDC docker container running, see [the main repo](https://github.com/atlarge-research/opendc) for more information on how to do this. + ## Architecture The codebase follows a standard React.js structure, with static assets being contained in the `public` folder, while dynamic components and their styles are contained in `src`. The app uses client-side routing (with `react-router`), meaning that the only HTML file needed to be served is a `index.html` file. @@ -68,3 +69,21 @@ Almost all state is kept in a central Redux store. State is kept there in an imm ### API Interaction The web-app needs to pull data in from the API of a backend running on a server. The functions that call routes are located in `src/api`. The actual logic responsible for calling these functions is contained in `src/sagas`. These API fetch procedures are written with the help of `redux-saga`. The [official documentation](https://redux-saga.js.org/) of `redux-saga` can be a helpful aid in understanding that part of the codebase. + + +## Tests + +Files containing tests can be recognized by the `.test.js` suffix. They are usually located right next to the source code they are testing, to make discovery easier. + +### Running all tests + +The following command runs all tests in the codebase. On top of this, it also watches the code for changes and reruns the tests when files are changed, automatically. + +```bash +yarn test +``` + + +## License + +The code is released under the MIT license. See `LICENSE.md`. -- cgit v1.2.3