For this example I used React with Mobx and for the testing Jest.
Once you clone run:
$ npm install
Then run: $ npm start
The application will run on localhost:3000
If you want at any point to run the tests please run: $ npm run test
The main development location is the src directory:
srcThe main source directoryApphas the store from mobx that passes it to the provider and then it is available to the containerscontainersTop app layers only one for this example the phoneContainer that observes changes to the phoneStore - once changes come available it sends the to the componentscomponentsReusable components receive data and dont directly talk to the store only receive data from the containersstoreThe store of the app for this it has a mapper that gets the data from a json file and transforms to a more readable version and then passes it to an observable.
It has some methods for setting the selected phone variant.
index.jsx is setting up the main app container.
The app container is loading all the other containers using the latest router and loads the phoneStore
All spec files are within actions, container, and each component.
npm run build
npm run test