<commit_before>'use strict';

import { async } from 'metal';
import dom from '../src/dom';
import globalEval from '../src/globalEval';

describe('globalEval', function() {
	before(function() {
		window.testScript = null;
	});

	afterEach(function() {
		window.testScript = null;
	});

	it('should evaluate script code in global scope', function() {
		globalEval.run('var testScript = 2 + 2;');
		assert.strictEqual(4, window.testScript);
	});

	it('should not leave created script tag in document after code is evaluated', function() {
		var newScript = globalEval.run('var testScript = 2 + 2;');
		assert.ok(!newScript.parentNode);
	});

	it('should evaluate script file in global scope', function(done) {
		var newScript = globalEval.runFile('base/fixtures/script.js');

		console.log('before load');
		dom.on(newScript, 'load', function() {
			console.log('after load');<commit_msg>Removes console.log calls<commit_after>'use strict';

import { async } from 'metal';
import dom from '../src/dom';
import globalEval from '../src/globalEval';

describe('globalEval', function() {
	before(function() {
		window.testScript = null;
	});

	afterEach(function() {
		window.testScript = null;
	});

	it('should evaluate script code in global scope', function() {
		globalEval.run('var testScript = 2 + 2;');
		assert.strictEqual(4, window.testScript);
	});

	it('should not leave created script tag in document after code is evaluated', function() {
		var newScript = globalEval.run('var testScript = 2 + 2;');
		assert.ok(!newScript.parentNode);
	});

	it('should evaluate script file in global scope', function(done) {
		var newScript = globalEval.runFile('base/fixtures/script.js');

		dom.on(newScript, 'load', function() {
{'fraction_non_alphanumeric': 0.15737514518002324, 'fraction_numerical': 0.005807200929152149, 'mean_word_length': 4.724252491694352, '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': '6843451', 'n_tokens_mistral': 555, 'n_tokens_neox': 515, 'n_words': 145}