Skip to content

Commit 9e708c5

Browse files
author
Philipp Alferov
committed
Implement basic tests
1 parent 349a471 commit 9e708c5

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

test/test.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,30 @@ describe('parent pointer array to tree', function() {
1414
});
1515

1616
it('should not modify passed object', function() {
17-
expect(current).not.to.be.equal(initial);
17+
expect(initial).to.be.deep.equal(initial);
18+
});
19+
20+
it('should return an array', function() {
21+
expect(current).to.be.an('array');
22+
});
23+
24+
it('should keep parent_id property', function() {
25+
var first = current[0];
26+
27+
expect(first).to.have.property('parent_id');
28+
});
29+
30+
it('should create nested objects with children', function() {
31+
var first = current[0];
32+
33+
expect(first)
34+
.to.have.property('children')
35+
.that.is.an('array')
36+
.to.have.length.of.at.least(1);
37+
});
38+
39+
it('should return an expected value', function() {
40+
expect(current).to.be.deep.equal(expected);
1841
});
1942

2043
})

0 commit comments

Comments
 (0)