File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ var toTree = require('../index.js');
66var initial = [
77 {
88 id : 1 ,
9- parent_id : null
9+ parent_id : null ,
10+ children : [ { id : 5 } ]
1011 } ,
1112 {
1213 id : 2 ,
@@ -25,13 +26,17 @@ var initial = [
2526var current ;
2627
2728describe ( 'array-to-tree' , function ( ) {
28- describe ( 'with valid arguments' , function ( ) {
29+ describe ( 'with default arguments' , function ( ) {
2930 beforeEach ( function ( ) {
3031 current = toTree ( initial ) ;
3132 } ) ;
3233
33- it ( 'should not modify passed object' , function ( ) {
34- expect ( initial ) . to . be . deep . equal ( initial ) ;
34+ it ( 'should not modify given array' , function ( ) {
35+ expect ( initial [ 0 ] ) . to . be . deep . equal ( {
36+ id : 1 ,
37+ parent_id : null ,
38+ children : [ { id : 5 } ]
39+ } ) ;
3540 } ) ;
3641
3742 it ( 'should return an array' , function ( ) {
@@ -96,7 +101,7 @@ describe('array-to-tree', function() {
96101 } ) ;
97102 } ) ;
98103
99- describe ( 'with different options ' , function ( ) {
104+ describe ( 'with custom arguments ' , function ( ) {
100105 it ( 'should work with custom parents links' , function ( ) {
101106 expect (
102107 toTree (
You can’t perform that action at this time.
0 commit comments