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.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question

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. 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,