Weather Monster - Demo
Search and select cities to see their min and max temperatures.
In order to run the app you need install dependencies.
Installing dependencies via npm
:
cd /project/root/directory
npm i
Installing dependencies via npm
:
cd /project/root/directory
yarn install
Once all the dependencies are installed, you can run the app from the project root directory with:
npm start
yarn start
Open http://localhost:3000 to view it in the browser.
This app is shipped with unit and integration tests. Unit tests are written using Jest and Enzyme and integration tests are written in Cypress.
npm run test
or
yarn test
Runs all the unit tests and launches the test runner in the interactive watch mode.
Generate unit test code coverage report with:
npm run test:coverage
or
yarn test:coverage
Cypress
is configured in such a way that it could run integration tests on command line. When it finishes it generates .mp4
video about how the app behaved during tests.
Before running Cypress
, make sure the app is running. Run Cypress
in command line with:
npm run test:e2e:run
or
yarn test:e2e:run
In order to view all the tests available and watch them running in browser, open Cypress
GUI with:
npm run test:e2e:open
or
yarn test:e2e:open
However, this is not a mature app yet, you can configure following options in src/config.js
the way you want.
- App name
- Search field placeholder text
- Notification messages (Error, loading data and empty state)
- Temperature units
For example, the default units of temperature are set to metric
i.e. Celsius
. In order to change it to imperial
i.e. fahrenheit
, refer src/constants.js
to find the name of constant variable and use in src/config.js
. Therefore, in src/config.js
, change:
export const units = constants.units.METRIC
with
export const units = constants.units.IMPERIAL
Since free version of https://openweathermap.org/current is not CORS enabled, therefore, a proxy is used in order to access it. Check src/endpoint/index.js
for more details.