<commit_before>(function($) {

	/** test suite */

	describe('Virtual Pointer', function() {
		before(function() {
			this.pointer = VirtualPointer(this);

			// adjusting time values for testing purposes
			this.pointer.DOUBLETAP_DURATION = 25;
			this.pointer.PRESS_DURATION = 25;
			this.pointer.FLICK_DURATION = 25;

			// ensure we are at the top
			window.scrollTo(0, 0);
			// prevent mocha from scrolling
			window.scrollTo = $.noop;
			// prevent user from scrolling
			$('body').css('overflow', 'hidden');
		});

		after(function() {
			// re-enable scrolling
			$('body').css('overflow', 'auto');
		});

		afterEach(function() {
			$('html, body').off();
		});

		describe('tap start', function() {
			it('should work with direct events', function() {
				var handler = sinon.spy();
				$('body').on(this.pointer.START_EVENT, handler);
				this.pointer.tapStart();
				handler.should.have.been.calledOnce;
				handler.should.have.been.calledOn(document.body);
			});

			it('should work with delegated events', function() {
				var handler = sinon.spy();
				$('html').on(this.pointer.START_EVENT, 'body', handler);
				this.pointer.tapStart();
				handler.should.have.been.calledOnce;
				handler.should.have.been.calledOn(document.body);
			});

			it('should work with target element', function() {
				var handler = sinon.spy();
				$('.target').on(this.pointer.START_EVENT, handler);<commit_msg>fixed phantomjs tests.<commit_after>(function($) {

	/** test suite */

	describe('Virtual Pointer', function() {
		before(function() {
			this.pointer = VirtualPointer(this);

			// adjusting time values for testing purposes
			this.pointer.DOUBLETAP_DURATION = 25;
			this.pointer.PRESS_DURATION = 25;
			this.pointer.FLICK_DURATION = 25;

			// ensure we are at the top
			window.scrollTo(0, 0);
			// prevent mocha from scrolling
			window.scrollTo = $.noop;
			// prevent user from scrolling
			$('body').css('overflow', 'hidden');

			// XXX: phantomjs does not implement Function#bind: https://github.com/ariya/phantomjs/issues/10522
			if (window.PHANTOMJS) {
				Function.prototype.bind = function(scope) {
					var self = this;
					return function() {
						self.apply(scope, arguments);
					}
				};
			}
		});

		after(function() {
			// re-enable scrolling
			$('body').css('overflow', 'auto');
		});

		afterEach(function() {
			$('html, body').off();
		});

		describe('tap start', function() {
			it('should work with direct events', function() {
				var handler = sinon.spy();
				$('body').on(this.pointer.START_EVENT, handler);
				this.pointer.tapStart();
				handler.should.have.been.calledOnce;
				handler.should.have.been.calledOn(document.body);
			});

			it('should work with delegated events', function() {
				var handler = sinon.spy();
				$('html').on(this.pointer.START_EVENT, 'body', handler);
				this.pointer.tapStart();
				handler.should.have.been.calledOnce;
				handler.should.have.been.calledOn(document.body);
			});

			it('should work with target element', function() {
				var handler = sinon.spy();
				$('.target').on(this.pointer.START_EVENT, handler);
{'fraction_non_alphanumeric': 0.16773778920308482, 'fraction_numerical': 0.006748071979434447, 'mean_word_length': 3.4156028368794327, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '898826', 'n_tokens_mistral': 1223, 'n_tokens_neox': 964, 'n_words': 203}