@@ -76,22 +76,28 @@ describe("utils", () => {
7676 expect ( parseRef ( "#/test/~1~0" ) ) . toStrictEqual ( { filename : "." , path : [ "test" , "/~" ] } ) ;
7777 } ) ;
7878
79+ it ( "remote ref" , ( ) => {
80+ expect ( parseRef ( "remote.yaml#/Subpath" ) ) . toStrictEqual ( { filename : "remote.yaml" , path : [ "Subpath" ] } ) ;
81+ expect ( parseRef ( "../schemas/remote.yaml#/Subpath" ) ) . toStrictEqual ( { filename : "../schemas/remote.yaml" , path : [ "Subpath" ] } ) ;
82+ expect ( parseRef ( "https://myschema.com/api/v1/openapi.yaml#/Subpath" ) ) . toStrictEqual ( { filename : "https://myschema.com/api/v1/openapi.yaml" , path : [ "Subpath" ] } ) ;
83+ } ) ;
84+
7985 it ( "js-yaml $ref" , ( ) => {
8086 expect ( parseRef ( 'components["schemas"]["SchemaObject"]' ) ) . toStrictEqual ( { filename : "." , path : [ "components" , "schemas" , "SchemaObject" ] } ) ;
8187 } ) ;
8288 } ) ;
8389
8490 describe ( "escObjKey" , ( ) => {
8591 it ( "basic" , ( ) => {
86- expect ( escObjKey ( "some-prop" ) ) . toStrictEqual ( "\" some-prop\"" ) ;
92+ expect ( escObjKey ( "some-prop" ) ) . toStrictEqual ( '" some-prop"' ) ;
8793 } ) ;
8894
8995 it ( "@ escapes" , ( ) => {
90- expect ( escObjKey ( "@type" ) ) . toStrictEqual ( "\" @type\"" ) ;
96+ expect ( escObjKey ( "@type" ) ) . toStrictEqual ( '" @type"' ) ;
9197 } ) ;
9298
9399 it ( "number escapes" , ( ) => {
94- expect ( escObjKey ( "123var" ) ) . toStrictEqual ( "\" 123var\"" ) ;
100+ expect ( escObjKey ( "123var" ) ) . toStrictEqual ( '" 123var"' ) ;
95101 } ) ;
96102
97103 it ( "only number no escapes" , ( ) => {
@@ -104,6 +110,6 @@ describe("utils", () => {
104110
105111 it ( "_ no escapes" , ( ) => {
106112 expect ( escObjKey ( "_ref_" ) ) . toStrictEqual ( "_ref_" ) ;
107- } )
108- } )
113+ } ) ;
114+ } ) ;
109115} ) ;
0 commit comments