File tree 2 files changed +23
-7
lines changed
2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -106,9 +106,7 @@ const mockSchema = {
106
106
params : [ ] ,
107
107
result : {
108
108
name : "fooResult" ,
109
- schema : {
110
- type : "boolean" ,
111
- } ,
109
+ value : true ,
112
110
} ,
113
111
} ,
114
112
] ,
@@ -177,8 +175,28 @@ describe("coverage", () => {
177
175
only : [ ] ,
178
176
} ;
179
177
180
- await coverage ( options ) ;
181
- expect ( spy ) . toHaveBeenCalledTimes ( 0 ) ;
178
+ await expect ( coverage ( options ) ) . rejects . toThrow ( 'No methods to test' ) ;
179
+ } ) ;
180
+ it ( "can get to expectedResult checking with no servers" , async ( ) => {
181
+ const reporter = new class CustomReporter {
182
+ onBegin ( ) { }
183
+ onTestBegin ( ) { }
184
+ onTestEnd ( ) { }
185
+ onEnd ( ) { }
186
+ } ;
187
+ const spy = jest . spyOn ( reporter , "onTestBegin" ) ;
188
+ const transport = ( ) => Promise . resolve ( { } ) ;
189
+ const openrpcDocument = { ...mockSchema } ;
190
+ openrpcDocument . servers = undefined ;
191
+ const options = {
192
+ reporter,
193
+ transport,
194
+ openrpcDocument,
195
+ skip : [ ] ,
196
+ only : [ 'baz' ] ,
197
+ } ;
198
+
199
+ await expect ( coverage ( options ) ) . resolves . toBeUndefined ( ) ;
182
200
} ) ;
183
201
} ) ;
184
202
describe ( "transport" , ( ) => {
Original file line number Diff line number Diff line change @@ -68,7 +68,6 @@ export default async (options: IOptions) => {
68
68
servers . forEach ( ( { url } ) => {
69
69
filteredMethods . forEach ( ( method ) => {
70
70
if ( method . examples === undefined || method . examples . length === 0 ) {
71
- console . log ( "method : " , method ) ;
72
71
for ( let i = 0 ; i < 10 ; i ++ ) {
73
72
const p = getFakeParams ( method . params ) ;
74
73
// handle object or array case
@@ -93,7 +92,6 @@ export default async (options: IOptions) => {
93
92
method . paramStructure === "by-name"
94
93
? paramsToObj ( p , method . params as ContentDescriptorObject [ ] )
95
94
: p ;
96
- console . log ( "params : " , params ) ;
97
95
exampleCalls . push ( {
98
96
title : method . name + " > example params and expect result to match: " + ex . name ,
99
97
methodName : method . name ,
You can’t perform that action at this time.
0 commit comments