@@ -76,31 +76,25 @@ describe('Polygon', () => {
7676      } ,  done . fail ) ; 
7777  } ) ; 
7878
79-   it ( 'fail save with 3 point minumum' ,  done  =>  { 
80-     try  { 
79+   it ( 'fail save with 3 point minumum' ,  ( )  =>  { 
80+     expect ( function   ( )  { 
8181      new  Parse . Polygon ( [ [ 0 ,  0 ] ] ) ; 
82-     }  catch  ( e )  { 
83-       done ( ) ; 
84-     } 
82+     } ) . toThrow ( ) ; 
8583  } ) ; 
8684
87-   it ( 'fail save with non array' ,  done  =>  { 
88-     try  { 
85+   it ( 'fail save with non array' ,  ( )  =>  { 
86+     expect ( function   ( )  { 
8987      new  Parse . Polygon ( 123 ) ; 
90-     }  catch  ( e )  { 
91-       done ( ) ; 
92-     } 
88+     } ) . toThrow ( ) ; 
9389  } ) ; 
9490
95-   it ( 'fail save with invalid array' ,  done  =>  { 
96-     try  { 
91+   it ( 'fail save with invalid array' ,  ( )  =>  { 
92+     expect ( function   ( )  { 
9793      new  Parse . Polygon ( [ [ 'str1' ] ,  [ 'str2' ] ,  [ 'str3' ] ] ) ; 
98-     }  catch  ( e )  { 
99-       done ( ) ; 
100-     } 
94+     } ) . toThrow ( ) ; 
10195  } ) ; 
10296
103-   it ( 'containsPoint' ,  done  =>  { 
97+   it ( 'containsPoint' ,  ( )  =>  { 
10498    const  points  =  [ 
10599      [ 0 ,  0 ] , 
106100      [ 0 ,  1 ] , 
@@ -113,10 +107,9 @@ describe('Polygon', () => {
113107
114108    assert . equal ( polygon . containsPoint ( inside ) ,  true ) ; 
115109    assert . equal ( polygon . containsPoint ( outside ) ,  false ) ; 
116-     done ( ) ; 
117110  } ) ; 
118111
119-   it ( 'equality' ,  done  =>  { 
112+   it ( 'equality' ,  ( )  =>  { 
120113    const  points  =  [ 
121114      [ 0 ,  0 ] , 
122115      [ 0 ,  1 ] , 
@@ -129,7 +122,6 @@ describe('Polygon', () => {
129122      [ 2 ,  2 ] , 
130123      [ 2 ,  0 ] , 
131124    ] ; 
132- 
133125    const  polygonA  =  new  Parse . Polygon ( points ) ; 
134126    const  polygonB  =  new  Parse . Polygon ( points ) ; 
135127    const  polygonC  =  new  Parse . Polygon ( diff ) ; 
@@ -140,11 +132,9 @@ describe('Polygon', () => {
140132
141133    assert . equal ( polygonA . equals ( true ) ,  false ) ; 
142134    assert . equal ( polygonA . equals ( polygonC ) ,  false ) ; 
143- 
144-     done ( ) ; 
145135  } ) ; 
146136
147-   it ( 'supports polygonContains' ,  done  =>  { 
137+   it ( 'supports polygonContains' ,  async   ( )  =>  { 
148138    const  p1  =  [ 
149139      [ 0 ,  0 ] , 
150140      [ 0 ,  1 ] , 
@@ -164,7 +154,6 @@ describe('Polygon', () => {
164154      [ 15 ,  10 ] , 
165155      [ 10 ,  10 ] , 
166156    ] ; 
167- 
168157    const  polygon1  =  new  Parse . Polygon ( p1 ) ; 
169158    const  polygon2  =  new  Parse . Polygon ( p2 ) ; 
170159    const  polygon3  =  new  Parse . Polygon ( p3 ) ; 
@@ -173,17 +162,12 @@ describe('Polygon', () => {
173162    const  obj2  =  new  TestObject ( {  polygon : polygon2  } ) ; 
174163    const  obj3  =  new  TestObject ( {  polygon : polygon3  } ) ; 
175164
176-     Parse . Object . saveAll ( [ obj1 ,  obj2 ,  obj3 ] ) 
177-       . then ( ( )  =>  { 
178-         const  point  =  new  Parse . GeoPoint ( 0.5 ,  0.5 ) ; 
179-         const  query  =  new  Parse . Query ( TestObject ) ; 
180-         query . polygonContains ( 'polygon' ,  point ) ; 
181-         return  query . find ( ) ; 
182-       } ) 
183-       . then ( results  =>  { 
184-         assert . equal ( results . length ,  2 ) ; 
185-         done ( ) ; 
186-       } ,  done . fail ) ; 
165+     await  Parse . Object . saveAll ( [ obj1 ,  obj2 ,  obj3 ] ) ; 
166+     const  point  =  new  Parse . GeoPoint ( 0.5 ,  0.5 ) ; 
167+     const  query  =  new  Parse . Query ( TestObject ) ; 
168+     query . polygonContains ( 'polygon' ,  point ) ; 
169+     const  results  =  await  query . find ( ) ; 
170+     assert . equal ( results . length ,  2 ) ; 
187171  } ) ; 
188172
189173  it ( 'polygonContains invalid input' ,  done  =>  { 
0 commit comments