Skip to content

Commit 349a471

Browse files
author
Philipp Alferov
committed
Switch to chai
1 parent 4ae858f commit 349a471

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
};

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
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"

test/test.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
var assert = require('assert');
2-
var should = require('should');
1+
'use strict';
2+
var chai = require('chai');
3+
var expect = chai.expect;
34
var toTree = require('../index.js');
45
var expected = require('./fixtures/expected.fixture.js');
56
var initial = require('./fixtures/initial.fixture.js');
67
var current;
78

89
describe('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
});

0 commit comments

Comments
 (0)