<commit_before>var AbstractBrowser = require('mock-browser').delegates.AbstractBrowser;
var MockBrowser = require('mock-browser').mocks.MockBrowser;
GLOBAL.window = MockBrowser.createWindow();
GLOBAL.document = MockBrowser.createDocument();

var browser = new AbstractBrowser({window: window});
GLOBAL.navigator = browser.getNavigator();

var baseDir= require('./basedir');
var DataFilter = require(baseDir + 'dataFilter');


var geoFilter = require(baseDir + 'geoFilter');
var testData = require('./testData.json');
var L = require('leaflet');

var assert = require('chai').assert;

var items = new DataFilter(testData).filter("");

describe("geoFilter", function(){
    it("should not return any items for zero max distance", function(){
        assert.equal(0, geoFilter([1, 1], items, 0).length);
    });
});<commit_msg>added some more filter tests<commit_after>var AbstractBrowser = require('mock-browser').delegates.AbstractBrowser;
var MockBrowser = require('mock-browser').mocks.MockBrowser;
GLOBAL.window = MockBrowser.createWindow();
GLOBAL.document = MockBrowser.createDocument();

var browser = new AbstractBrowser({window: window});
GLOBAL.navigator = browser.getNavigator();

var baseDir= require('./basedir');
var DataFilter = require(baseDir + 'dataFilter');


var geoFilter = require(baseDir + 'geoFilter');
var testData = require('./testData.json');
var L = require('leaflet');

var assert = require('chai').assert;

var items = new DataFilter(testData).filter("");

describe("geoFilter", function(){
    it("should not return any items for zero max distance", function(){
        assert.equal(0, geoFilter([1, 1], items, 0).length);
    });

    it("should only return item 7", function(){
        assert.equal(7, geoFilter([-122.32779622077942, 37.89016347485787], items, 1)[0].id);
    });

    it("should work with L.LatLong objects", function(){
        assert.equal(7, geoFilter(L.latLng([-122.32779622077942, 37.89016347485787]), items, 1)[0].id);
    });
});
{'fraction_non_alphanumeric': 0.16330645161290322, 'fraction_numerical': 0.040826612903225805, 'mean_word_length': 5.423948220064725, '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': '7020022', 'n_tokens_mistral': 631, 'n_tokens_neox': 581, 'n_words': 142}