File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed
Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 1+ function clone ( obj ) {
2+ return JSON . parse ( JSON . stringify ( obj ) ) ;
3+ }
4+
5+ module . exports = function ( obj ) {
6+ var cloned = clone ( obj ) ;
7+
8+ return cloned ;
9+ } ;
Original file line number Diff line number Diff line change 1515 ],
1616 "devDependencies" : {
1717 "babel-core" : " ^5.8.24" ,
18+ "chai" : " ^3.2.0" ,
1819 "eslint" : " ^1.4.1" ,
1920 "gulp" : " ^3.9.0" ,
2021 "gulp-mocha" : " ^2.1.3" ,
21- "mocha" : " ^2.3.0" ,
22- "should" : " ^7.1.0"
22+ "mocha" : " ^2.3.0"
2323 },
2424 "author" : " Philipp Alferov <philipp.alferov@gmail.com>" ,
2525 "license" : " MIT"
Original file line number Diff line number Diff line change 1- var assert = require ( 'assert' ) ;
2- var should = require ( 'should' ) ;
1+ 'use strict' ;
2+ var chai = require ( 'chai' ) ;
3+ var expect = chai . expect ;
34var toTree = require ( '../index.js' ) ;
45var expected = require ( './fixtures/expected.fixture.js' ) ;
56var initial = require ( './fixtures/initial.fixture.js' ) ;
67var current ;
78
89describe ( 'parent pointer array to tree' , function ( ) {
10+ describe ( 'expected behavior' , function ( ) {
911
12+ beforeEach ( function ( ) {
13+ current = toTree ( initial ) ;
14+ } ) ;
15+
16+ it ( 'should not modify passed object' , function ( ) {
17+ expect ( current ) . not . to . be . equal ( initial ) ;
18+ } ) ;
19+
20+ } )
1021} ) ;
You can’t perform that action at this time.
0 commit comments