<commit_before>/*global describe:false, before:false, after:false, it:false*/
'use strict';

var assert = require('assert'),
	JsxPreprocessor = require('..');

describe('parse', function () {

	it('should replace `pre` tag by handler', function () {
		var handler = {
			tagName: 'pre',

			onTag: function (attrs) {
				return 'awesome preprocessor';
			}
		};

		var res,
			src = 'React.render(<div><h1>Hello, world!</h1><pre type="content" /></div>,document.getElementById("example"));';

		res = JsxPreprocessor.process(src, handler);

		assert.strictEqual(res, 'React.render(<div><h1>Hello, world!</h1>awesome preprocessor</div>,document.getElementById("example"));');
	});

	it('should handle multiple handlers', function () {
		var handlers = [{<commit_msg>modify test description<commit_after>/*global describe:false, before:false, after:false, it:false*/
'use strict';

var assert = require('assert'),
	JsxPreprocessor = require('..');

describe('process', function () {

	it('should replace `pre` tag by handler', function () {
		var handler = {
			tagName: 'pre',

			onTag: function (attrs) {
				return 'awesome preprocessor';
			}
		};

		var res,
			src = 'React.render(<div><h1>Hello, world!</h1><pre type="content" /></div>,document.getElementById("example"));';

		res = JsxPreprocessor.process(src, handler);

		assert.strictEqual(res, 'React.render(<div><h1>Hello, world!</h1>awesome preprocessor</div>,document.getElementById("example"));');
	});

	it('should handle multiple handlers', function () {
		var handlers = [{
{'fraction_non_alphanumeric': 0.1867704280155642, 'fraction_numerical': 0.005188067444876783, 'mean_word_length': 5.147410358565737, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '4252412', 'n_tokens_mistral': 532, 'n_tokens_neox': 475, 'n_words': 106}