File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import { PostService } from '@/services/post.service' ;
22import { PostRepository } from '@/repositories/post.repository' ;
33import { DBError } from '@/exception' ;
4+ import { Pool } from 'pg' ;
45
56jest . mock ( '@/repositories/post.repository' ) ;
67
78// 모든 파라미터는 Route 단에서 검증하기 때문에 파라미터를 제대로 받았는지는 확인하지 않음
89describe ( 'PostService' , ( ) => {
910 let postService : PostService ;
1011 let postRepo : jest . Mocked < PostRepository > ;
11- let mockPool : any ;
12+ let mockPool : jest . Mocked < Pool > ;
1213
1314 beforeEach ( ( ) => {
14- mockPool = { } ;
15-
15+ mockPool = { } as jest . Mocked < Pool > ;
1616 postRepo = new PostRepository ( mockPool ) as jest . Mocked < PostRepository > ;
1717 postService = new PostService ( postRepo ) ;
1818 } ) ;
@@ -50,7 +50,7 @@ describe('PostService', () => {
5050 postRepo . findPostsByUserId . mockResolvedValue ( mockPosts ) ;
5151
5252 const result = await postService . getAllposts ( 1 ) ;
53- console . log ( result ) ;
53+
5454 expect ( result . posts ) . toEqual ( [
5555 {
5656 id : '519211' ,
You can’t perform that action at this time.
0 commit comments