Skip to content
This repository was archived by the owner on Oct 18, 2018. It is now read-only.

Commit 062deb8

Browse files
Hoang Chau KhanhHoang Chau Khanh
authored andcommitted
Add test to check tree prop (#15)
1 parent fb84217 commit 062deb8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
},
5555
"jest": {
5656
"automock": false,
57+
"testRegex": "test/.*\\.js$",
5758
"coverageDirectory": "coverage/",
5859
"collectCoverage": true
5960
}

__tests__/react-tree-test.js renamed to test/react-tree-test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@ describe('ReactTree', () => {
2525

2626
expect(handleOnChanged).toBeCalled();
2727
});
28+
29+
it('should show error when tree is not object or array', () => {
30+
const reactTree = TestUtils.renderIntoDocument(
31+
<ReactTree tree={1} />
32+
);
33+
34+
expect(ReactTree.propTypes.tree).toBeDefined();
35+
});
2836
});

0 commit comments

Comments
 (0)