1- import MethodCallMethodNotFoundError from "./method-not-found-error" ;
1+ import MethodNotFoundError from "./method-not-found-error" ;
22import { OpenRPC } from "@open-rpc/meta-schema" ;
33
44const exampleDoc = {
@@ -10,25 +10,26 @@ const exampleDoc = {
1010 openrpc : "1.1.9" ,
1111} as OpenRPC ;
1212
13- describe ( "MethodCallMethodNotFoundError " , ( ) => {
13+ describe ( "MethodNotFoundError " , ( ) => {
1414 it ( "can be instantiated" , ( ) => {
15- const error = new MethodCallMethodNotFoundError ( "floobar" , exampleDoc , [ "abc" , 123 ] ) ;
16- expect ( error ) . toBeInstanceOf ( MethodCallMethodNotFoundError ) ;
15+ const error = new MethodNotFoundError ( "floobar" , exampleDoc , [ "abc" , 123 ] ) ;
16+ expect ( error ) . toBeInstanceOf ( MethodNotFoundError ) ;
1717 } ) ;
1818
1919 it ( "works when no params passed" , ( ) => {
20- const error = new MethodCallMethodNotFoundError ( "floobar" , exampleDoc ) ;
21- expect ( error ) . toBeInstanceOf ( MethodCallMethodNotFoundError ) ;
20+ const error = new MethodNotFoundError ( "floobar" , exampleDoc ) ;
21+ expect ( error ) . toBeInstanceOf ( MethodNotFoundError ) ;
2222 } ) ;
2323
2424 it ( "properly parses params in to a string" , ( ) => {
25- const error = new MethodCallMethodNotFoundError ( "floobar" , exampleDoc , [ "abc" , { abc : 123 } , 123 ] ) ;
26- expect ( error ) . toBeInstanceOf ( MethodCallMethodNotFoundError ) ;
25+ const error = new MethodNotFoundError ( "floobar" , exampleDoc , [ "abc" , { abc : 123 } , 123 ] ) ;
26+ expect ( error ) . toBeInstanceOf ( MethodNotFoundError ) ;
2727 expect ( error . message ) . toBe ( `Method Not Found Error for OpenRPC API named "testerino"
2828The requested method: "floobar" not a valid method.
29-
30- debug info:
31- params: "abc", {"abc":123}, 123` ) ;
29+ Params:
30+ "abc"
31+ {"abc":123}
32+ 123` ) ;
3233 } ) ;
3334
3435 it ( "it handles openrpc docs with a method" , ( ) => {
@@ -42,8 +43,8 @@ debug info:
4243 } ,
4344 } ,
4445 ] ;
45- const error = new MethodCallMethodNotFoundError ( "floobar" , exampleDoc , [ "abc" , { abc : 123 } , 123 ] ) ;
46- expect ( error ) . toBeInstanceOf ( MethodCallMethodNotFoundError ) ;
46+ const error = new MethodNotFoundError ( "floobar" , exampleDoc , [ "abc" , { abc : 123 } , 123 ] ) ;
47+ expect ( error ) . toBeInstanceOf ( MethodNotFoundError ) ;
4748 expect ( error . message ) . toContain ( "Valid method names are as follows: dooptiedoo" ) ;
4849 } ) ;
4950} ) ;
0 commit comments