@@ -12,7 +12,7 @@ describe('array-to-tree', function() {
1212 describe ( 'with valid arguments' , function ( ) {
1313
1414 beforeEach ( function ( ) {
15- current = toTree ( { data : initial } ) ;
15+ current = toTree ( initial ) ;
1616 } ) ;
1717
1818 it ( 'should not modify passed object' , function ( ) {
@@ -45,14 +45,14 @@ describe('array-to-tree', function() {
4545
4646 describe ( 'with invalid arguments' , function ( ) {
4747 it ( 'should return an empty array if the empty array passed' , function ( ) {
48- expect ( toTree ( { data : [ ] } ) ) . to . be . deep . equal ( [ ] ) ;
48+ expect ( toTree ( [ ] ) ) . to . be . deep . equal ( [ ] ) ;
4949 } ) ;
5050
5151 it ( 'should throw an error if wrong arguments passed' , function ( ) {
52- expect ( toTree . bind ( null , { data : 'string' } ) )
52+ expect ( toTree . bind ( null , 'string' ) )
5353 . to . throw ( / i n v a l i d a r g u m e n t / ) ;
5454
55- expect ( toTree . bind ( null , { data : { } } ) )
55+ expect ( toTree . bind ( null , { } ) )
5656 . to . throw ( / i n v a l i d a r g u m e n t / ) ;
5757 } ) ;
5858
@@ -63,19 +63,17 @@ describe('array-to-tree', function() {
6363 return item ;
6464 } ) ;
6565
66- expect ( toTree ( { data : modified } ) )
66+ expect ( toTree ( modified ) )
6767 . to . be . deep . equal ( modified ) ;
6868 } ) ;
6969 } )
7070
7171 describe ( 'with different options' , function ( ) {
7272 it ( 'should work with custom parents links' , function ( ) {
7373
74- current = toTree ( {
75- data : customInitial ,
76- parentProperty : 'parent' ,
77- customID : '_id'
78- } ) ;
74+ current = toTree (
75+ customInitial ,
76+ { parentProperty : 'parent' , customID : '_id' } ) ;
7977
8078 expect ( current )
8179 . to . be . deep . equal ( customExpected ) ;
0 commit comments