@@ -12,7 +12,7 @@ describe('array-to-tree', function() {
12
12
describe ( 'with valid arguments' , function ( ) {
13
13
14
14
beforeEach ( function ( ) {
15
- current = toTree ( { data : initial } ) ;
15
+ current = toTree ( initial ) ;
16
16
} ) ;
17
17
18
18
it ( 'should not modify passed object' , function ( ) {
@@ -45,14 +45,14 @@ describe('array-to-tree', function() {
45
45
46
46
describe ( 'with invalid arguments' , function ( ) {
47
47
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 ( [ ] ) ;
49
49
} ) ;
50
50
51
51
it ( 'should throw an error if wrong arguments passed' , function ( ) {
52
- expect ( toTree . bind ( null , { data : 'string' } ) )
52
+ expect ( toTree . bind ( null , 'string' ) )
53
53
. to . throw ( / i n v a l i d a r g u m e n t / ) ;
54
54
55
- expect ( toTree . bind ( null , { data : { } } ) )
55
+ expect ( toTree . bind ( null , { } ) )
56
56
. to . throw ( / i n v a l i d a r g u m e n t / ) ;
57
57
} ) ;
58
58
@@ -63,19 +63,17 @@ describe('array-to-tree', function() {
63
63
return item ;
64
64
} ) ;
65
65
66
- expect ( toTree ( { data : modified } ) )
66
+ expect ( toTree ( modified ) )
67
67
. to . be . deep . equal ( modified ) ;
68
68
} ) ;
69
69
} )
70
70
71
71
describe ( 'with different options' , function ( ) {
72
72
it ( 'should work with custom parents links' , function ( ) {
73
73
74
- current = toTree ( {
75
- data : customInitial ,
76
- parentProperty : 'parent' ,
77
- customID : '_id'
78
- } ) ;
74
+ current = toTree (
75
+ customInitial ,
76
+ { parentProperty : 'parent' , customID : '_id' } ) ;
79
77
80
78
expect ( current )
81
79
. to . be . deep . equal ( customExpected ) ;
0 commit comments