1
1
import { expect } from "chai" ;
2
2
import step from "../../../lib/step" ;
3
- import { Draft04 as Core } from "../../../lib/draft04" ;
3
+ import { Draft04 } from "../../../lib/draft04" ;
4
4
5
5
describe ( "step.oneof" , ( ) => {
6
- let draft : Core ;
7
- before ( ( ) => ( draft = new Core ( ) ) ) ;
6
+ let draft : Draft04 ;
7
+ before ( ( ) => ( draft = new Draft04 ( ) ) ) ;
8
8
9
9
it ( "should return matching schema" , ( ) => {
10
10
const res = step (
@@ -88,7 +88,7 @@ describe("step.oneof", () => {
88
88
} ) ;
89
89
90
90
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" , {
92
92
type : "object" ,
93
93
properties : {
94
94
innerTitle : { $ref : "#/definitions/number" }
@@ -97,7 +97,7 @@ describe("step.oneof", () => {
97
97
number : { type : "number" , title : "Zahl" }
98
98
}
99
99
} ) ;
100
- const schema = core . compileSchema ( {
100
+ const schema = draft . compileSchema ( {
101
101
type : "object" ,
102
102
properties : {
103
103
title : {
@@ -111,11 +111,11 @@ describe("step.oneof", () => {
111
111
}
112
112
}
113
113
} ) ;
114
- const res = step ( core , "title" , schema , { title : { innerTitle : 111 } } ) ;
114
+ const res = step ( draft , "title" , schema , { title : { innerTitle : 111 } } ) ;
115
115
116
116
expect ( res . type ) . to . eq ( "object" ) ;
117
117
118
- const nextRes = step ( core , "innerTitle" , res , { innerTitle : 111 } ) ;
118
+ const nextRes = step ( draft , "innerTitle" , res , { innerTitle : 111 } ) ;
119
119
expect ( nextRes . type ) . to . eq ( "number" ) ;
120
120
} ) ;
121
121
} ) ;
0 commit comments