Skip to content

Commit 5e3c7c3

Browse files
committed
Fix test code to run with any number of contents
1 parent 37c20af commit 5e3c7c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/article.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { findFirstArticleBySlug, getAllArticleSlugs, getArticlePreviews } from './article';
22

33
test('getArticlePreviews', () => {
4-
const pageSize = 3
4+
const pageSize = 1
55
const articles = getArticlePreviews(1, pageSize)
66

77
expect(articles.pageSize).toBe(pageSize)
@@ -10,7 +10,7 @@ test('getArticlePreviews', () => {
1010

1111
test('getAllArticleSlugs', () => {
1212
const articleSlugs = getAllArticleSlugs()
13-
expect(articleSlugs).toHaveLength(5)
13+
expect(articleSlugs.length).toBeGreaterThanOrEqual(1)
1414
})
1515

1616
test('findFirstArticleBySlug', () => {

0 commit comments

Comments
 (0)