Skip to content

Developing on the Simulator

Austin Greene edited this page Jul 14, 2016 · 2 revisions

Developing on the WDC Simulator

Installing Dependencies

All you should need to do is run npm install. This may take a few minutes.

Running the Simulator

To run the simulator use the command npm start. This should start up the web server needed access the simulator. Navigate to http://localhost:8888/Simulator in the browser of your choice to get to it.

Bundling the Simulator

The most recent bundle of the simulator should be included in the repository at all times, but if you make any changes you will need to refresh it. To do this use the command npm run bundle which create a new bundle of the code if your code passes the linter. You may also use npm run bundle:watch to continuously create a bundle as you work or the command npm run start:bundle to start the server and continuously create a bundle as you work.

Testing the Simulator

To run all possible tests on the simulator with code coverage, simply use the command npm test. If you would like to run just the unit tests, use the command npm run unit of npm run unit:coverage if you would like a coverage report of the unit tests. To run just the end-to-end tests, use the command npm run end-to-end, note that if the environment variables FOURSQUARE_USERNAME and FOURSQUARE_PASSWORD are undefined the Foursquare oauth tests will be skipped.

Folder Stucture

  • Simulator
    • Actions <- (Where all Redux actions and thunks go)
      • simulator-actions.js <- (All of the actions and thunks related to updating the state of simulator itself)
      • messaging-actions.js <- (All of the actions and thunks related to communicating between the simulator and the WDCs)
    • Reducers <- (Where all Redux reducers go)
      • reducers.js <- (All of the reducers, currently no need to split it up)
    • Store <- (Where the Redux store lives)
      • store.js <- (exports the store object)
    • Components <- (Where all the React Components go)
      • ... All the components
    • Utils <- (Where all the utility functions go)
      • consts.js <- (all of the constants referenced through out the simulator)
      • validation.js <- (all of the functions for validating schemas and data)
      • misc.js <- (miscellaneous utility functions)
    • Tests <- (Where all the tests are)
      • end-to-end <- (end to end tests, a general one, an oauth one, and one for each example)
        • ... All end to end tests
      • unit <- (unit tests, for each utility, action, reducer, and component)
        • ... All unit test

Technology Reference