Setup for local development and testing
Unarchive page assets into project directory
There are two archives containing assets used by the project. Using the
tar command, unarchive them both into the
js and the equipment images
going into a directory named
Next, retrieve the emoji images from Henrik Joreteg's project,
emoji-images. Clone that repository of images into
Ensure page behaves normally with your API information
Using your user id and api token, ensure the page loads correctly and behaves exactly like oldgods.net. Resolve any missing assets and ensure no errors exist in your browser's developer console.
You may need to add a
null.htm file, and you may doing so by simply creating an empty file named
the root of the project directory using:
Uncomment TST sections of main page
There are 4 TST sections on the main page. The first is a set of script tags which bring in:
- A series of
- A library for mocking ajax requests.
- Enables test data to be substituted in without actually communicating with HabitRPG.
- No login necessary for every refresh
- Testdata files
- Each file sets a variable containing a long JSON string
- These strings will inevitably fall out of date, and should be updated as changes are made to HabitRPG
- Contributors are encouraged to create their own testdata files which may be composed with the existing sets.
- JS Mocks
- Here is where the actual mocking of ajax requests occurs, as well as the auto-fetch of user data (to avoid the need to log in).
- The test data may be manipulated here to suit any particular test case.
- Alternate webserver configurations
- Use these configurations if you have an alternate webserver already set up to serve the requests from the page.
- Style and form auto-load * This section provides a background style to make it obvious when working with test data * It will also auto-load the login form to save a step on a reload
If you wish to use the mocks to avoid making remote requests for data, then uncomment the
sections. Otherwise, only uncomment the section for alternate webserver configuration to redirect any ajax calls to
the new webserver.
The final section with style and auto-load should always be uncommented for convenience with working with test data.