<commit_before>/*global kontext, describe, beforeEach, it, expect*/
describe('Kontext', function() {
	'use strict';

	var model;

	beforeEach(function() {
		document.body.insertBefore(document.createTextNode('a {foo:fool} walks into a {bar:trap}'), document.body.firstChild);

		model = kontext.bind({
			foo: 'bar',
			bar: 'baz'
		}, document.body);
	});

	it('notifies change', function(done) {
		var notes = 0;

		kontext.on('update', function(model, key, old) {
			++notes;

			expect(old).toBe('bar');
		});

		model.on('update', function(model, key, old) {
			++notes;

			expect(old).toBe('bar');
			expect(notes).toBe(2);

			done();
		});<commit_msg>Modified the way we work with html<commit_after>/*global kontext, describe, afterEach, beforeEach, it, expect*/
describe('Kontext', function() {
	'use strict';

	beforeEach(function(done) {
		var content = '<p>A {foo:fool} walks into a {bar:trap}',
			wrapper = document.body.insertBefore(document.createElement('div'), document.body.firstChild);

		wrapper.setAttribute('id', 'fixture');

		document.body.insertBefore(wrapper, document.body.firstChild);

		done();
	});

	afterEach(function(done) {
		var wrapper = document.querySelector('#fixture');

		if (wrapper) {
			wrapper.parentNode.removeChild(wrapper);
		}

		done();
	});

	it('notifies change', function(done) {
		var notes = 0,
			model = kontext.bind({
				foo: 'bar',
				bar: 'baz'
			}, document.body);

		kontext.on('update', function(model, key, old) {
			++notes;

			expect(old).toBe('bar');
		});

		model.on('update', function(model, key, old) {
			++notes;

			expect(old).toBe('bar');
			expect(notes).toBe(2);

			done();
		});
{'fraction_non_alphanumeric': 0.18870192307692307, 'fraction_numerical': 0.002403846153846154, 'mean_word_length': 4.252365930599369, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7009322', 'n_tokens_mistral': 647, 'n_tokens_neox': 559, 'n_words': 116}