Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 6b09ad0

Browse files
committed
Add more tests
1 parent 7cfd72a commit 6b09ad0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/index.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,29 @@ describe('getBlogPosts', () => {
55
const posts = await getBlogPosts()
66
expect(posts).toBeInstanceOf(Array)
77
})
8+
9+
it('should return an array of posts', async () => {
10+
const posts = await getBlogPosts(4)
11+
expect(posts).toBeInstanceOf(Array)
12+
})
13+
14+
it('should throw an error', async () => {
15+
await expect(getBlogPosts(1000)).rejects.toThrow()
16+
})
817
})
918

1019
describe('getUpdatePosts', () => {
1120
it('should return an array of posts', async () => {
1221
const posts = await getUpdatePosts()
1322
expect(posts).toBeInstanceOf(Array)
1423
})
24+
25+
it('should return an array of posts', async () => {
26+
const posts = await getUpdatePosts(4)
27+
expect(posts).toBeInstanceOf(Array)
28+
})
29+
30+
it('should throw an error', async () => {
31+
await expect(getUpdatePosts(1000)).rejects.toThrow()
32+
})
1533
})

0 commit comments

Comments
 (0)