Skip to content

Commit

Permalink
remove add reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
Octowl committed Nov 4, 2024
1 parent 89ab8a9 commit 6918278
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
13 changes: 0 additions & 13 deletions objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,6 @@ function addSecondAuthor(book, additionalAuthor) {
// write your code here...
}

/**
* addReviews
*
* - receives a book object
* - receives an array of review objects
*
* - returns the book object with a `reviews` property that contains the reviews array
*/
function addReviews(book, reviews) {
// write your code here...
}

/**
* 🌶️🌶️🌶️ addReview
*
Expand All @@ -111,6 +99,5 @@ module.exports = {
addISBN,
updatePublishedYear,
addSecondAuthor,
addReviews,
addReview,
};
16 changes: 0 additions & 16 deletions objects.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const {
addISBN,
updatePublishedYear,
addSecondAuthor,
addReviews,
} = require("./objects.js");

describe("Book Object Manipulations", () => {
Expand Down Expand Up @@ -73,28 +72,13 @@ describe("Book Object Manipulations", () => {
expect(updatedBook.publishedYear).toBe(publishYear);
});
});
});

describe("Advanced Object Operations", () => {
describe("addSecondAuthor", () => {
it("should modify the author property to include an additional author", () => {
const secondAuthor = faker.person.fullName();
const updatedBook = addSecondAuthor(book, secondAuthor);
expect(updatedBook.author).toEqual([book.author, secondAuthor]);
});
});

describe("Add Reviews", () => {
it("should add reviews to the book", () => {
const reviews = Array(10)
.fill(0)
.map(() => ({
reviewer: faker.person.fullName(),
comment: faker.lorem.sentence(),
}));
const updatedBook = addReviews(book, reviews);
expect(updatedBook.reviews).toEqual(reviews);
});
});
});
});

0 comments on commit 6918278

Please sign in to comment.