@@ -2,7 +2,7 @@ var test = require('tape')
22 , convert = require ( '../' )
33;
44
5- test ( 'iterates allOfs and converts types ' , function ( assert ) {
5+ test ( 'iterates allOfs' , function ( assert ) {
66 var schema
77 , result
88 , expected
@@ -17,14 +17,16 @@ test('iterates allOfs and converts types', function(assert) {
1717 required : [ 'foo' ] ,
1818 properties : {
1919 foo : {
20- type : 'long'
20+ type : 'integer' ,
21+ format : 'int64'
2122 }
2223 }
2324 } ,
2425 {
2526 allOf : [
2627 {
27- type : 'double'
28+ type : 'number' ,
29+ format : 'double'
2830 }
2931 ]
3032 }
@@ -56,11 +58,11 @@ test('iterates allOfs and converts types', function(assert) {
5658 }
5759 ]
5860 } ;
59-
61+
6062 assert . deepEqual ( result , expected , 'iterated allOfs' ) ;
6163} ) ;
6264
63- test ( 'iterates anyOfs and converts types ' , function ( assert ) {
65+ test ( 'iterates anyOfs' , function ( assert ) {
6466 var schema
6567 , result
6668 , expected
@@ -75,7 +77,7 @@ test('iterates anyOfs and converts types', function(assert) {
7577 required : [ 'foo' ] ,
7678 properties : {
7779 foo : {
78- type : 'long '
80+ type : 'integer '
7981 }
8082 }
8183 } ,
@@ -85,7 +87,7 @@ test('iterates anyOfs and converts types', function(assert) {
8587 type : 'object' ,
8688 properties : {
8789 bar : {
88- type : 'double '
90+ type : 'number '
8991 }
9092 }
9193 }
@@ -105,7 +107,6 @@ test('iterates anyOfs and converts types', function(assert) {
105107 properties : {
106108 foo : {
107109 type : 'integer' ,
108- format : 'int64'
109110 }
110111 }
111112 } ,
@@ -116,19 +117,18 @@ test('iterates anyOfs and converts types', function(assert) {
116117 properties : {
117118 bar : {
118119 type : 'number' ,
119- format : 'double'
120120 }
121121 }
122122 }
123123 ]
124124 }
125125 ]
126126 } ;
127-
127+
128128 assert . deepEqual ( result , expected , 'anyOfs iterated' ) ;
129129} ) ;
130130
131- test ( 'iterates oneOfs and converts types ' , function ( assert ) {
131+ test ( 'iterates oneOfs' , function ( assert ) {
132132 var schema
133133 , result
134134 , expected
@@ -143,7 +143,7 @@ test('iterates oneOfs and converts types', function(assert) {
143143 required : [ 'foo' ] ,
144144 properties : {
145145 foo : {
146- type : 'long '
146+ type : 'integer '
147147 }
148148 }
149149 } ,
@@ -153,7 +153,7 @@ test('iterates oneOfs and converts types', function(assert) {
153153 type : 'object' ,
154154 properties : {
155155 bar : {
156- type : 'double '
156+ type : 'number '
157157 }
158158 }
159159 }
@@ -173,7 +173,6 @@ test('iterates oneOfs and converts types', function(assert) {
173173 properties : {
174174 foo : {
175175 type : 'integer' ,
176- format : 'int64'
177176 }
178177 }
179178 } ,
@@ -184,15 +183,14 @@ test('iterates oneOfs and converts types', function(assert) {
184183 properties : {
185184 bar : {
186185 type : 'number' ,
187- format : 'double'
188186 }
189187 }
190188 }
191189 ]
192190 }
193191 ]
194192 } ;
195-
193+
196194 assert . deepEqual ( result , expected , 'oneOfs iterated' ) ;
197195} ) ;
198196
@@ -208,8 +206,9 @@ test('converts types in not', function(assert) {
208206 type : 'object' ,
209207 properties : {
210208 not : {
211- type : 'password' ,
212- minLength : 8
209+ type : 'string' ,
210+ format : 'password' ,
211+ minLength : 8
213212 }
214213 }
215214 } ;
@@ -223,11 +222,11 @@ test('converts types in not', function(assert) {
223222 not : {
224223 type : 'string' ,
225224 format : 'password' ,
226- minLength : 8
225+ minLength : 8
227226 }
228227 }
229228 } ;
230-
229+
231230 assert . deepEqual ( result , expected , 'not handled' ) ;
232231} ) ;
233232
@@ -241,8 +240,9 @@ test('converts types in not', function(assert) {
241240
242241 schema = {
243242 not : {
244- type : 'password' ,
245- minLength : 8
243+ type : 'string' ,
244+ format : 'password' ,
245+ minLength : 8
246246 }
247247 } ;
248248
@@ -253,10 +253,10 @@ test('converts types in not', function(assert) {
253253 not : {
254254 type : 'string' ,
255255 format : 'password' ,
256- minLength : 8
256+ minLength : 8
257257 }
258258 } ;
259-
259+
260260 assert . deepEqual ( result , expected , 'not handled' ) ;
261261} ) ;
262262
@@ -349,6 +349,6 @@ test('nested combination keywords', function(assert) {
349349 }
350350 ]
351351 } ;
352-
352+
353353 assert . deepEqual ( result , expected , 'nested combination keywords' ) ;
354354} ) ;
0 commit comments