@@ -9,6 +9,9 @@ test('locationToFeature', t => {
9
9
let result = oci . locationToFeature ( [ 0 , 0 ] ) ;
10
10
t . notEqual ( result , null ) ;
11
11
t . equal ( result . type , 'point' ) ;
12
+ t . type ( result . feature , 'object' ) ;
13
+ t . type ( result . feature . properties , 'object' ) ;
14
+ t . match ( result . feature . properties , { area : / \d + / } ) ; // has a numeric area property
12
15
t . end ( ) ;
13
16
} ) ;
14
17
t . test ( 'an invalid [lon,lat] coordinate pair returns a null match' , t => {
@@ -25,6 +28,9 @@ test('locationToFeature', t => {
25
28
let result = oci . locationToFeature ( 'philly_metro.geojson' , oci . features ) ;
26
29
t . notEqual ( result , null ) ;
27
30
t . equal ( result . type , 'geojson' ) ;
31
+ t . type ( result . feature , 'object' ) ;
32
+ t . type ( result . feature . properties , 'object' ) ;
33
+ t . match ( result . feature . properties , { area : / \d + / } ) ; // has a numeric area property
28
34
t . end ( ) ;
29
35
} ) ;
30
36
t . test ( 'an invalid `.geojson` filename in this project returns a null match' , t => {
@@ -41,6 +47,9 @@ test('locationToFeature', t => {
41
47
let result = oci . locationToFeature ( 'gb' ) ;
42
48
t . notEqual ( result , null ) ;
43
49
t . equal ( result . type , 'countrycoder' ) ;
50
+ t . type ( result . feature , 'object' ) ;
51
+ t . type ( result . feature . properties , 'object' ) ;
52
+ t . match ( result . feature . properties , { area : / \d + / } ) ; // has a numeric area property
44
53
t . end ( ) ;
45
54
} ) ;
46
55
t . test ( 'an invalid country coder feature identifier returns a null match' , t => {
0 commit comments