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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education