@@ -20,14 +20,14 @@ afterAll(async() => {
20
20
21
21
describe ( "http.get" , ( ) => {
22
22
it ( "should GET uptime from local fastify server" , async ( ) => {
23
- const { data } = await get < { uptime : number } > ( "/local/" ) ;
23
+ const { data } = await get < { uptime : number ; } > ( "/local/" ) ;
24
24
25
25
expect ( "uptime" in data ) . toStrictEqual ( true ) ;
26
26
expect ( typeof data . uptime ) . toStrictEqual ( "number" ) ;
27
27
} ) ;
28
28
29
29
it ( "should GET query parameters provided to fastify" , async ( ) => {
30
- const { data } = await get < { name : string } > ( "/local/qs" , {
30
+ const { data } = await get < { name : string ; } > ( "/local/qs" , {
31
31
querystring : new URLSearchParams ( {
32
32
name : "foobar"
33
33
} )
@@ -38,7 +38,7 @@ describe("http.get", () => {
38
38
} ) ;
39
39
40
40
it ( "should GET uptime by following an HTTP redirection from local fastify server" , async ( ) => {
41
- const { data } = await get < { uptime : number } > ( "/local/redirect" , { maxRedirections : 1 } ) ;
41
+ const { data } = await get < { uptime : number ; } > ( "/local/redirect" , { maxRedirections : 1 } ) ;
42
42
43
43
expect ( "uptime" in data ) . toStrictEqual ( true ) ;
44
44
expect ( typeof data . uptime ) . toStrictEqual ( "number" ) ;
@@ -52,7 +52,7 @@ describe("http.get", () => {
52
52
53
53
return callback ( ) ;
54
54
} ;
55
- const { data } = await get < { uptime : number } > ( "/local/" , { limit } ) ;
55
+ const { data } = await get < { uptime : number ; } > ( "/local/" , { limit } ) ;
56
56
57
57
expect ( "uptime" in data ) . toStrictEqual ( true ) ;
58
58
expect ( typeof data . uptime ) . toStrictEqual ( "number" ) ;
@@ -122,13 +122,12 @@ describe("http.post", () => {
122
122
userId : 1
123
123
} ;
124
124
125
- const { data } = await post < typeof body & { userId : number } > ( "https://jsonplaceholder.typicode.com/posts" , { body } ) ;
125
+ const { data } = await post < typeof body & { userId : number ; } > ( "https://jsonplaceholder.typicode.com/posts" , { body } ) ;
126
126
expect ( typeof data . userId ) . toStrictEqual ( "number" ) ;
127
127
expect ( data ) . toMatchObject ( body ) ;
128
128
} ) ;
129
129
} ) ;
130
130
131
-
132
131
describe ( "http.put" , ( ) => {
133
132
it ( "should PUT data on jsonplaceholder API" , async ( ) => {
134
133
const body = {
@@ -138,7 +137,7 @@ describe("http.put", () => {
138
137
userId : 1
139
138
} ;
140
139
141
- const { data } = await put < typeof body & { userId : number } > ( "https://jsonplaceholder.typicode.com/posts/1" , { body } ) ;
140
+ const { data } = await put < typeof body & { userId : number ; } > ( "https://jsonplaceholder.typicode.com/posts/1" , { body } ) ;
142
141
expect ( data ) . toEqual ( body ) ;
143
142
} ) ;
144
143
} ) ;
@@ -151,7 +150,7 @@ describe("http.patch", () => {
151
150
userId : 1
152
151
} ;
153
152
154
- const { data } = await patch < typeof body & { userId : number } > ( "https://jsonplaceholder.typicode.com/posts/1" , {
153
+ const { data } = await patch < typeof body & { userId : number ; } > ( "https://jsonplaceholder.typicode.com/posts/1" , {
155
154
body : { title : "foo" }
156
155
} ) ;
157
156
expect ( data ) . toMatchObject ( body ) ;
@@ -169,7 +168,7 @@ describe("http.del", () => {
169
168
170
169
describe ( "http.safeGet" , ( ) => {
171
170
it ( "should GET uptime from local fastify server" , async ( ) => {
172
- const result = await safeGet < { uptime : number } , any > ( "/local/" ) ;
171
+ const result = await safeGet < { uptime : number ; } , any > ( "/local/" ) ;
173
172
174
173
expect ( result . ok ) . toStrictEqual ( true ) ;
175
174
const { data } = result . unwrap ( ) ;
0 commit comments