11import { expect } from "chai" ;
22import step from "../../../lib/step" ;
3- import { Draft04 as Core } from "../../../lib/draft04" ;
3+ import { Draft04 } from "../../../lib/draft04" ;
44
55describe ( "step.oneof" , ( ) => {
6- let draft : Core ;
7- before ( ( ) => ( draft = new Core ( ) ) ) ;
6+ let draft : Draft04 ;
7+ before ( ( ) => ( draft = new Draft04 ( ) ) ) ;
88
99 it ( "should return matching schema" , ( ) => {
1010 const res = step (
@@ -88,7 +88,7 @@ describe("step.oneof", () => {
8888 } ) ;
8989
9090 it ( "should maintain references from a remote schema when resolving oneOf with $ref" , ( ) => {
91- core . addRemoteSchema ( "https://my-other-schema.com/schema.json" , {
91+ draft . addRemoteSchema ( "https://my-other-schema.com/schema.json" , {
9292 type : "object" ,
9393 properties : {
9494 innerTitle : { $ref : "#/definitions/number" }
@@ -97,7 +97,7 @@ describe("step.oneof", () => {
9797 number : { type : "number" , title : "Zahl" }
9898 }
9999 } ) ;
100- const schema = core . compileSchema ( {
100+ const schema = draft . compileSchema ( {
101101 type : "object" ,
102102 properties : {
103103 title : {
@@ -111,11 +111,11 @@ describe("step.oneof", () => {
111111 }
112112 }
113113 } ) ;
114- const res = step ( core , "title" , schema , { title : { innerTitle : 111 } } ) ;
114+ const res = step ( draft , "title" , schema , { title : { innerTitle : 111 } } ) ;
115115
116116 expect ( res . type ) . to . eq ( "object" ) ;
117117
118- const nextRes = step ( core , "innerTitle" , res , { innerTitle : 111 } ) ;
118+ const nextRes = step ( draft , "innerTitle" , res , { innerTitle : 111 } ) ;
119119 expect ( nextRes . type ) . to . eq ( "number" ) ;
120120 } ) ;
121121} ) ;
0 commit comments