<commit_before>describe('treewalker test case', function() {
	
	var treewalker = require('../');
	
	var node = {
		name : 'parent',
		childs : [{
			name : 'child-1',
			childs : []
		}, {
			name : 'child-2',
			childs : []
		}]
	};
	
	var newNode = {
		name : 'king',
		childs : []
	};

	describe('Insertion Test Case', function() {
		it('It should should be able to insert successfully', function() {
			treewalker.resolveTree(node, 'childs', function(obj) {
				if (obj.name === 'parent') {
					//shollow copy the object and push
					var newObj = {};
					for (var key in newNode) {
						newObj[key] = newNode[key];
					}
					obj.childs.push(newObj);
					return true;
				}
			});
			treewalker.resolveTree(node, 'childs', function(obj) {
				if (obj.name === 'parent') {
					obj.childs.forEach(function(obj) {
						if (obj.name === newNode.name) {
							for (var key in obj) {
								if (!obj[key] === newNode[key]) {
									throw new Error('Insertion Failed');
								}
							}
						}
					});
				}
			});
		});
	});
});<commit_msg>Update test.js<commit_after>describe('treewalker test case', function() {
	
	var treewalker = require('../');
	
	var node = {
		name : 'parent',
		childs : [{
			name : 'child-1',
			childs : []
		}, {
			name : 'child-2',
			childs : []
		}]
	};
	
	var newNode = {
		name : 'king',
		childs : []
	};

	describe('Insertion Test Case', function() {
		it('It should should be able to insert successfully', function() {
			treewalker.resolveTree(node, 'childs', function(obj) {
				throw new Error('Insertion Failed');
				if (obj.name === 'parent') {
					//shollow copy the object and push
					var newObj = {};
					for (var key in newNode) {
						newObj[key] = newNode[key];
					}
					obj.childs.push(newObj);
					return true;
				}
			});
			treewalker.resolveTree(node, 'childs', function(obj) {
				throw new Error('Insertion Failed');
				if (obj.name === 'parent') {
					obj.childs.forEach(function(obj) {
						if (obj.name === newNode.name) {
							for (var key in obj) {
								if (!obj[key] === newNode[key]) {
									throw new Error('Insertion Failed');
								}
							}
						}
					});
				}
			});
		});
	});
});
{'fraction_non_alphanumeric': 0.17845732542218165, 'fraction_numerical': 0.0018256503879507074, 'mean_word_length': 2.3465648854961834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '290746', 'n_tokens_mistral': 1006, 'n_tokens_neox': 735, 'n_words': 173}