This assignment required us to utilize node js, and related npm pacakges (such as inquirer) to create some specific HTML content based on user inputs. We also had to create unit tests using npm Jest and demonstrate the functionality in walk through videos. Screenshots and a demo video (gif format) can be found below.
Demo Video For Main Application
Demo Video For Unit Tests With jest
This project challenged me more than the prior ones. I further familiarized myself with arrow functions, and used unit testing for the first time. In prior front end projects I would write my code top to bottom as it was "happening" (since it was typically being started with an on-click event and functions were hoisted), but this time I defined functions as expressions near the top of the page in some instances, and invoked them later. I wrapped my starting sequence in a small init. function that I call at the very bottom of the index.js script.
All my unit tests for my classes and related methods / constructors passed. In one instance, I was actually able to successfully use them to catch an issue I would have otherwise missed.
I used validation to confirm inquirer prompt responses. For all questions, some validation (example cannot be blank, has to be number or text...) was present.
Below are some images and screenshots showcasing parts of this application and what it produces.
Screenshot of Rendered HTML on Desktop
Screenshot of Rendered HTML on Mobile
Screenshot CLI after setting up new employees
Screenshot CLI after execution of unit testing
This application can be used to quickly generate a static team profile page in html format. By running the application from the terminal you can enter prompted answers to questions, and have the answers written into a formatted page that is mobile responsive.
To install this application you just need to ensure that you have nodeJS and run the npm i command to get required dependencies (inquirer and jest). For jest, make sure the package.json tests object has jest entered for its tests property.
https://opensource.org/licenses/MIT
Email me at [email protected] for more information.
For this assignment I utilized class notes and recordings, as well as some MDM and W3 schools. I also reviewed the npm documentation for jest and inquirer for specific questions dealing with setup and validation.