Your task is to take the given starter code and convert it into a working Node.js command-line application. This application will take in information about employees on a software engineering team, then generates an HTML webpage that displays summaries for each person. You have been provided with tests, so make sure every part of your code passes each provided test.
As a manager a user want to generate a webpage that displays my team's basic info so that a user have quick access to their emails and GitHub profiles.
- Create a command-line application that accepts accepts user input using the provided starter code.
- Create classes for each team member provided and export them. The tests for these classes (in the
_tests_
directory) must ALL pass.- The first class is an
Employee
parent class with the following properties and methods:name
id
email
getName()
getId()
getEmail()
getRole()
—returns'Employee'
- The other three classes will extend
Employee
. - In addition to
Employee
's properties and methods,Manager
will also have the following:officeNumber
getRole()
—overridden to return'Manager'
- In addition to
Employee
's properties and methods,Engineer
will also have the following:github
—GitHub usernamegetGithub()
getRole()
—overridden to return'Engineer'
- In addition to
Employee
's properties and methods,Intern
will also have the following:school
getSchool()
getRole()
—overridden to return'Intern'
- Finally, although it’s not a requirement, consider adding validation to ensure that user input is in the proper format.
- The first class is an
- Write code in
index.js
that uses inquirer to gather information about the development team members and creates objects for each team member using the correct classes as blueprints.- When a user starts the application then they are prompted to enter the team manager’s:
- Name
- Employee ID
- Email address
- Office number
- When a user enters those requirements then the user is presented with a menu with the option to:
- Add an engineer
- Add an intern
- Finish building the team
- When a user selects the engineer option then a user is prompted to enter the following and then the user is taken back to the menu:
- Engineer's Name
- ID
- GitHub username
- When a user selects the intern option then a user is prompted to enter the following and then the user is taken back to the menu:
- Intern’s name
- ID
- School
- When a user decides to finish building their team then they exit the application, and the HTML is generated.
- When a user starts the application then they are prompted to enter the team manager’s:
- Call the
render
function (provided for you) and pass in an array containing all employee objects;- The
render
function will generate and return a block of HTML including templated divs for each employee!
- The
- Create an HTML file using the HTML returned from the
render
function.- Write it to a file named
team.html
in theoutput
folder. - You can use the provided variable
outputPath
to target this location.
- Write it to a file named
- Create classes for each team member provided and export them. The tests for these classes (in the
The following image shows a mock-up of the generated HTML’s appearance and functionality:
The styling in the image is just an example, so feel free to add your own.
This Challenge will combine many of the skills we've covered so far. In addition to the User Story and Acceptance Criteria, we’ve provided some guidelines to help get started.
Your application should use Jest for running the unit tests and Inquirer for collecting input from the user. The application will be invoked by using the following command:
node index.js
-
You will want to make your methods as pure as possible. This means try to make your methods simple so that they are easier to test.
-
The different employee types should all inherit some methods and properties from a base class of
Employee
. -
Be sure to test out each class and verify it generates an object with the correct structure and methods. This structure will be crucial in order for the provided
render
function to work! -
You may need to check if the
output
folder exists and create it if it does not.
This Challenge is graded based on the following criteria:
-
A sample HTML file generated using the application must be submitted.
-
Your GitHub repository containing your application code.
-
Satisfies all of the preceding acceptance criteria plus the following:
-
Uses the Inquirer package.
-
All tests pass using the Jest package.
-
The application must have
Employee
,Manager
,Engineer
, andIntern
classes.
-
-
Repository has a unique name.
-
Repository follows best practices for file structure and naming conventions.
-
Repository follows best practices for class/id naming conventions, indentation, quality comments, etc.
-
Repository contains multiple descriptive commit messages.
-
Repository contains a high-quality readme with description.
You are required to submit the following for review:
-
A sample HTML file generated using your application.
-
The URL of the GitHub repository, with a unique name and a readme describing the project.
© 2023 edX Boot Camps LLC. Confidential and Proprietary. All Rights Reserved.