Created by: tannakartikey
Following things are included in this PR:
- Tests setup and configuration
- A spec to calculate Level component.
- A spec that downloads state data from API and then compares the data with the map files (
public/maps/*
) and reports discrepancy if any. It fails on the first error it finds instead of reporting errors in all the states. This limitation is due to https://github.com/facebook/jest/issues/1619 - Another spec runs dynamically for each state against the static data downloaded from the API and extracted from the maps file. This test is helpful right now to see where the data has discrepancies. Once fixed we can get rid of this test
- Under
testUtils/index.js
there are two functions that return an object with state names as keys and cities as values using the API and map files(public/maps/
). - Some data cleaning. A few of the map files did not follow the convention the same as other files. Now they all follow the same standards for storing the cities data. For example, if the file name is
gujarat.json
then the cities will be found undergujarat_district
property so on and so forth.
Command to run the specs:
yarn test
Ref: #355 (closed)