@@ -18,7 +18,7 @@ describe("dereferenceDocument", () => {
18
18
19
19
it ( "doesnt explode" , async ( ) => {
20
20
expect . assertions ( 1 ) ;
21
- const document = await dereferenceDocument ( workingDocument , defaultResolver ) ;
21
+ const document = await dereferenceDocument ( workingDocument ) ;
22
22
expect ( document . methods ) . toBeDefined ( ) ;
23
23
} ) ;
24
24
@@ -33,7 +33,7 @@ describe("dereferenceDocument", () => {
33
33
{ name : "abc" , params : [ ] , result : { name : "cba" , schema : { type : "number" } } }
34
34
] ,
35
35
openrpc : "1.0.0-rc1" ,
36
- } , defaultResolver ) ;
36
+ } ) ;
37
37
expect ( document . methods ) . toBeDefined ( ) ;
38
38
} ) ;
39
39
@@ -43,13 +43,13 @@ describe("dereferenceDocument", () => {
43
43
...workingDocument ,
44
44
"x-methods" : {
45
45
foobar : {
46
- name : "foobar" ,
47
- params : [ ] ,
48
- result : {
49
- name : "abcfoo" ,
50
- schema : { type : "number" }
51
- }
52
- }
46
+ name : "foobar" ,
47
+ params : [ ] ,
48
+ result : {
49
+ name : "abcfoo" ,
50
+ schema : { type : "number" }
51
+ }
52
+ }
53
53
} ,
54
54
components : {
55
55
schemas : {
@@ -102,9 +102,9 @@ describe("dereferenceDocument", () => {
102
102
schema : { $ref : "#/components/schemas/bigOlFoo" }
103
103
}
104
104
} ) ;
105
- testDoc . methods . push ( { "$ref" :"#/x-methods/foobar" } )
105
+ testDoc . methods . push ( { "$ref" : "#/x-methods/foobar" } )
106
106
107
- const document = await dereferenceDocument ( testDoc , defaultResolver ) ;
107
+ const document = await dereferenceDocument ( testDoc ) ;
108
108
const docMethods = document . methods as MethodObject [ ] ;
109
109
expect ( docMethods ) . toBeDefined ( ) ;
110
110
expect ( docMethods [ 0 ] ) . toBeDefined ( ) ;
@@ -158,7 +158,7 @@ describe("dereferenceDocument", () => {
158
158
}
159
159
} as OpenrpcDocument ;
160
160
161
- const document = await dereferenceDocument ( testDoc , defaultResolver ) ;
161
+ const document = await dereferenceDocument ( testDoc ) ;
162
162
expect ( document . methods ) . toBeDefined ( ) ;
163
163
expect ( document . methods [ 0 ] ) . toBeDefined ( ) ;
164
164
@@ -204,7 +204,7 @@ describe("dereferenceDocument", () => {
204
204
} ;
205
205
206
206
try {
207
- await dereferenceDocument ( testDoc as OpenrpcDocument , defaultResolver )
207
+ await dereferenceDocument ( testDoc as OpenrpcDocument )
208
208
} catch ( e ) {
209
209
expect ( e ) . toBeInstanceOf ( OpenRPCDocumentDereferencingError ) ;
210
210
}
@@ -231,7 +231,7 @@ describe("dereferenceDocument", () => {
231
231
} ;
232
232
233
233
try {
234
- await dereferenceDocument ( testDoc as OpenrpcDocument , defaultResolver )
234
+ await dereferenceDocument ( testDoc as OpenrpcDocument )
235
235
} catch ( e ) {
236
236
expect ( e ) . toBeInstanceOf ( OpenRPCDocumentDereferencingError ) ;
237
237
}
@@ -261,7 +261,7 @@ describe("dereferenceDocument", () => {
261
261
} ;
262
262
263
263
try {
264
- await dereferenceDocument ( testDoc as OpenrpcDocument , defaultResolver )
264
+ await dereferenceDocument ( testDoc as OpenrpcDocument )
265
265
} catch ( e ) {
266
266
expect ( e ) . toBeInstanceOf ( OpenRPCDocumentDereferencingError ) ;
267
267
}
@@ -299,7 +299,7 @@ describe("dereferenceDocument", () => {
299
299
}
300
300
} ;
301
301
302
- const result = await dereferenceDocument ( testDoc as OpenrpcDocument , defaultResolver ) as any ;
302
+ const result = await dereferenceDocument ( testDoc as OpenrpcDocument ) as any ;
303
303
304
304
expect ( result . methods [ 0 ] . links [ 0 ] ) . toBe ( testDoc . components . links . fooLink )
305
305
} ) ;
@@ -325,7 +325,7 @@ describe("dereferenceDocument", () => {
325
325
]
326
326
} ;
327
327
328
- const result = await dereferenceDocument ( testDoc as OpenrpcDocument , defaultResolver ) as any ;
328
+ const result = await dereferenceDocument ( testDoc as OpenrpcDocument ) as any ;
329
329
330
330
expect ( result . methods [ 0 ] . result . schema . type ) . toBe ( "string" )
331
331
} ) ;
@@ -361,12 +361,12 @@ describe("dereferenceDocument", () => {
361
361
}
362
362
} ;
363
363
364
- const result = await dereferenceDocument ( testDoc as OpenrpcDocument , defaultResolver ) as any ;
364
+ const result = await dereferenceDocument ( testDoc as OpenrpcDocument ) as any ;
365
365
366
366
expect ( result . methods [ 0 ] . result . schema . properties . foo ) . toBe ( result . components . schemas . foo ) ;
367
367
} ) ;
368
368
369
- it ( "throws when a schema cannot be resolved from componnets " , async ( ) => {
369
+ it ( "throws when a schema cannot be resolved from components " , async ( ) => {
370
370
expect . assertions ( 1 ) ;
371
371
372
372
const testDoc = {
@@ -399,7 +399,7 @@ describe("dereferenceDocument", () => {
399
399
} ;
400
400
401
401
try {
402
- await dereferenceDocument ( testDoc as OpenrpcDocument , defaultResolver ) as any ;
402
+ await dereferenceDocument ( testDoc as OpenrpcDocument ) as any ;
403
403
} catch ( e ) {
404
404
expect ( e ) . toBeInstanceOf ( OpenRPCDocumentDereferencingError ) ;
405
405
}
0 commit comments