@@ -34,7 +34,8 @@ describe('property encoding', function () {
3434 a : 'two' ,
3535 b : 2 ,
3636 c : { goodbye : 'planet' } ,
37- d : { hello : 'world' }
37+ d : { hello : 'world' } ,
38+ e : false
3839 } ,
3940 geometry : {
4041 type : 'Point' ,
@@ -52,11 +53,13 @@ describe('property encoding', function () {
5253
5354 const first = layer . feature ( 0 ) . properties
5455 const second = layer . feature ( 1 ) . properties
55- expect ( first . c ) . toEqual ( '{"hello":"world"}' )
56- expect ( first . d ) . toEqual ( '[1,2,3]' )
57- expect ( first . e ) . toEqual ( undefined )
58- expect ( second . c ) . toEqual ( '{"goodbye":"planet"}' )
59- expect ( second . d ) . toEqual ( '{"hello":"world"}' )
56+ expect ( first . b ) . toStrictEqual ( 1 )
57+ expect ( first . c ) . toStrictEqual ( '{"hello":"world"}' )
58+ expect ( first . d ) . toStrictEqual ( '[1,2,3]' )
59+ expect ( first . e ) . toStrictEqual ( undefined )
60+ expect ( second . c ) . toStrictEqual ( '{"goodbye":"planet"}' )
61+ expect ( second . d ) . toStrictEqual ( '{"hello":"world"}' )
62+ expect ( second . e ) . toStrictEqual ( false )
6063 } )
6164
6265 test ( 'number encoding https://github.com/mapbox/vt-pbf/pull/11' , function ( ) {
@@ -121,7 +124,7 @@ test('id encoding', function () {
121124 const layer = vt . layers . geojsonLayer
122125 expect ( layer . feature ( 0 ) . id ) . toEqual ( 123 )
123126 expect ( layer . feature ( 1 ) . id ) . toBeFalsy ( ) // 'Non-integer values should not be saved'
124- expect ( layer . feature ( 2 ) . id ) . toBeFalsy ( )
127+ expect ( layer . feature ( 2 ) . id ) . toBeUndefined ( )
125128} )
126129
127130test ( 'accept geojson-vt options https://github.com/mapbox/vt-pbf/pull/21' , function ( ) {
0 commit comments