Book Donation App Create a book-app directory. The app can be used to manage book donations and track donors and books. The catalog is implemented using the following classes: 1. The app should have donors-repo.js to maintain the list of donors and allow adding, updating, and deleting donors. The donor object has donorID, firstName, lastName, and email properties. This module should implement the following functions: • getDonor(donorId): returns a donor by id. • addDonor(donor): adds a donor to the list of donors; donorID should be autoassigned a random number. • updateDonor(donor): updates the donor having the matching donorID. • deleteDonor(donorID): delete the donor with donorID from the list of donors, only if they are not associated with any books. 2. The app should have books-repo.js to maintain the list of donated books and allow adding, updating, and deleting books. The book object has bookID, title, authors, and donorID properties. • donorID references the book’s donor. This module should implement the following functions: • addBook(book): adds a book to the list of books. bookID should be auto-assigned a random number. • updateBook(book): updates the book having the matching bookID. • deleteBook(bookID): delete the book with bookID from the list of books. • getBooksByDonor(donorID): returns the list of books donated by a particular donor. 3. Create an app.js file and test the app functionality using few books and donors. 2 of 2 Unit Testing Create a file books-repo.spec.js under book-app/test and use Mocha/Chai to test the books repository functions. Please help especially with the testing point (3) using JavaScript.
Book Donation App
Create a book-app directory. The app can be used to manage book donations and track donors and books. The catalog is implemented using the following classes:
1. The app should have donors-repo.js to maintain the list of donors and allow adding, updating, and deleting donors. The donor object has donorID, firstName, lastName, and email properties. This module should implement the following functions:
• getDonor(donorId): returns a donor by id.
• addDonor(donor): adds a donor to the list of donors; donorID should be autoassigned a random number.
• updateDonor(donor): updates the donor having the matching donorID.
• deleteDonor(donorID): delete the donor with donorID from the list of donors, only if they are not associated with any books.
2. The app should have books-repo.js to maintain the list of donated books and allow adding, updating, and deleting books. The book object has bookID, title, authors, and donorID properties.
• donorID references the book’s donor. This module should implement the following functions:
• addBook(book): adds a book to the list of books. bookID should be auto-assigned a random number.
• updateBook(book): updates the book having the matching bookID.
• deleteBook(bookID): delete the book with bookID from the list of books.
• getBooksByDonor(donorID): returns the list of books donated by a particular donor.
3. Create an app.js file and test the app functionality using few books and donors. 2 of 2 Unit Testing
Create a file books-repo.spec.js under book-app/test and use Mocha/Chai to test the books repository functions.
Please help especially with the testing point (3) using JavaScript.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)