File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,15 @@ steps:
16
16
post :
17
17
include :
18
18
path : test_post.yml
19
+ postError :
20
+ include :
21
+ path : test_post_error.yml
19
22
comment :
20
23
include :
21
24
path : test_comment.yml
25
+ commentError :
26
+ include :
27
+ path : test_comment_error.yml
22
28
profile :
23
29
include :
24
30
path : test_profile.yml
Original file line number Diff line number Diff line change
1
+ desc : " comment endpoint error tests"
2
+ runners :
3
+ req :
4
+ endpoint : http://localhost:3000
5
+ vars :
6
+ duplicateCommentId : 1
7
+ if : included
8
+ steps :
9
+ postCommentDuplicateIdError :
10
+ desc : " Failed due to duplicate ID"
11
+ req :
12
+ /comments :
13
+ post :
14
+ body :
15
+ application/json :
16
+ id : " {{ vars.duplicateCommentId }}"
17
+ text : " new comment"
18
+ post_id : " {{ vars.postId }}"
19
+ test : |
20
+ // Status code must be 409.
21
+ current.res.status == 409
22
+ getCommentNotFoundError :
23
+ desc : " Post is not found"
24
+ req :
25
+ /comments/999999 :
26
+ get :
27
+ body :
28
+ application/json : null
29
+ test : |
30
+ // Status code must be 404.
31
+ current.res.status == 404
Original file line number Diff line number Diff line change
1
+ desc : " post endpoint error tests"
2
+ runners :
3
+ req :
4
+ endpoint : http://localhost:3000
5
+ vars :
6
+ duplicatePostId : " 01J7BAKH37HPG116ZRRFKHBDGB"
7
+ if : included
8
+ steps :
9
+ postPostDuplicateIdError :
10
+ desc : " Failed due to duplicate ID"
11
+ req :
12
+ /posts :
13
+ post :
14
+ body :
15
+ application/json :
16
+ id : " {{ vars.duplicatePostId }}"
17
+ title : " new post"
18
+ views : 0
19
+ test : |
20
+ // Status code must be 409.
21
+ current.res.status == 409
22
+ getPostNotFoundError :
23
+ desc : " Comment is not found"
24
+ req :
25
+ /posts/notfound :
26
+ get :
27
+ body :
28
+ application/json : null
29
+ test : |
30
+ // Status code must be 404.
31
+ current.res.status == 404
You can’t perform that action at this time.
0 commit comments