The goals of this challenge was to build a simple, command line application that allows user to filter through a JSON object data by 'location' and returns the associated 'models'.
This was written in JavaScript as this is the language I am most comfortable in.
- General:
- JavaScript
- Jest
- Others:
- GitHub
-
I started by analysing what the requirements of the task was (i.e. return the 'models' that match the 'location' the user wants to filter for)
-
Next, I planned out the individual steps/logic required to return the required output
-
Along the way, I used console logs to help debug any errors against expected outputs
- GitHub repository containing project code
- Readme document containing thought processes and any assumptions made
- Automated tests as necessary
- A simple, command line application that allows users to filter through a JSON Object Data by 'location' and returns the associated 'models'
If you wish to run it locally, you will need to follow the steps below:
- Fork or Clone the GitHub repository (https://github.com/tams2429/CLI-modelFilter),
- In the root project folder, run
npm install
to install all dependencies, npm test
to run all the Jest Tests for the whole application,node modelFilter.js
to run the function,
- I have tried to implement a simple test using Jest which is based on the provided input and output,
- Given more experience and time on this, I would try to find more 'edge' cases (i.e. malformed data) and implement those tests,