<commit_before>﻿import * as Merge from './merge';

describe('merge.service', () => {

	const testSettingsObject = {};

	const foo = Merge.merge(testSettingsObject);

	it('should return true if resultObject.updated === 3', () => {
		const resultObject = foo([1,2,3], [1,2,3,40,50,60,70,80], []);
		const res = resultObject.updated === 3;

		expect(res).to.be.equal(true);
	});

	it('should return true if resultObject.inserted === 5', () => {
		const resultObject = foo([1], [1,2,3,4,5,6], []);
		const res = resultObject.inserted === 5;

		expect(res).to.be.equal(true);
	});

	it('should return true if resultObject.removed === 5', () => {
		const resultObject = foo([1,2,3,4,5,6], [1], []);
		const res = resultObject.removed === 5;

		expect(res).to.be.equal(true);
	});
});
<commit_msg>Update merge.spec.js<commit_after>import * as Merge from './merge';

describe('merge.service', () => {

	const settings = {};
	const foo = Merge.merge(settings);

	it('should return number of items of property updated and set values to result array', () => {
		let left = [1,2,3];
		let right = [1,2,3,40,50,60,70,80];
		let result = [];
		const resultObject = foo(left,right,result);

		expect(resultObject.updated).to.be.equal(3);
		expect(JSON.stringify(result)).to.equal('[40,50,60,70,80]');
	});

	it('should return number of items of property inserted and set values to result array', () => {
		let left = [1];
		let right = [1,2,3,4,5,6];
		let result = [];
		const resultObject = foo(left,right,result);

		expect(resultObject.inserted).to.be.equal(5);
		expect(JSON.stringify(result)).to.equal('[2,3,4,5,6]');
	});

	it('should return number of items of property removed', () => {
		let left = [1,2,3,4,5,6];
		let right = [1];
		let result = [];
		const resultObject = foo(left,right,result);

		expect(resultObject.removed).to.be.equal(5);
		expect(JSON.stringify(result)).to.equal('[]');
	});
});

{'fraction_non_alphanumeric': 0.20853080568720378, 'fraction_numerical': 0.044233807266982623, 'mean_word_length': 4.475504322766571, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6864835', 'n_tokens_mistral': 735, 'n_tokens_neox': 672, 'n_words': 143}