Skip to content

Commit

Permalink
test with undefined and empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
OzakIOne committed Feb 16, 2024
1 parent 8bbc6c7 commit a9c5799
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,4 +473,20 @@ describe('blog sort', () => {
});
expect(sortedBlogPosts).toEqual(ascendingBlogPost);
});

it('sort blog posts with empty function', () => {
const sortedBlogPosts = sortBlogPosts({
blogPosts: BlogPostList,
sortPosts: () => {},
});
expect(sortedBlogPosts).toEqual(ascendingBlogPost);
});

it('sort blog posts with function return empty array', () => {
const sortedBlogPosts = sortBlogPosts({
blogPosts: BlogPostList,
sortPosts: () => [],
});
expect(sortedBlogPosts).toEqual(ascendingBlogPost);
});
});

0 comments on commit a9c5799

Please sign in to comment.