@@ -3,10 +3,12 @@ const buildPath = require('./buildPath');
3
3
test ( 'build path' , ( ) => {
4
4
const expected = {
5
5
"dir" : "api.github.com/users/user" ,
6
- "goFilePath" : "api.github.com/users/user/repos.go" ,
7
- "jsonFilePath" : "api.github.com/users/user/repos.json" ,
8
- "paramGoFilePath" : "api.github.com/users/user/repos_param.go" ,
9
- "paramJsonFilePath" : "api.github.com/users/user/repos_param.json" ,
6
+ "goFilePath" : "api.github.com/users/user/repos_get.go" ,
7
+ "jsonFilePath" : "api.github.com/users/user/repos_get.json" ,
8
+ "queryGoFilePath" : "api.github.com/users/user/repos_get_query.go" ,
9
+ "queryJsonFilePath" : "api.github.com/users/user/repos_get_query.json" ,
10
+ "bodyGoFilePath" : "api.github.com/users/user/repos_get_body.go" ,
11
+ "bodyJsonFilePath" : "api.github.com/users/user/repos_get_body.json" ,
10
12
"path" : {
11
13
"pathFormat" : "/users/{user}/repos" ,
12
14
"pathname" : "/users/github/repos" ,
@@ -16,9 +18,13 @@ test('build path', () => {
16
18
"pkg" : "user" ,
17
19
"struct" : "Repos"
18
20
}
21
+ let opts = {
22
+ method : "GET" ,
23
+ }
19
24
const received = buildPath (
20
25
new URL ( "https://api.github.com/users/github/repos" ) ,
21
- "./src/.api-to-go.test.yml"
26
+ "./src/.api-to-go.test.yml" ,
27
+ opts
22
28
)
23
29
expect ( received ) . toEqual ( expected ) ;
24
30
} ) ;
0 commit comments