<commit_before>'use strict';

var assert = require('assert');
var testHelper = require('../helper');


describe('closest', function () {

    var QUERY_SOURCE = 'select * from airbnb_rooms';
    var QUERY_TARGET = 'select * from atm_machines';

    var analysisDefinition = {
        type: 'closest',
        params: {
            source: {
                type: 'source',
                params: {
                    query: QUERY_SOURCE
                }
            },
            target: {
                type: 'source',
                params: {
                    query: QUERY_TARGET
                }
            },
            responses: 2,
            category: "bank"
        }
    };

    it('basic CLOSEST test', function (done) {
        testHelper.createAnalyses(analysisDefinition, function (err, closest) {

            assert.ifError(err);

            var rootNode = closest.getRoot();

            testHelper.getRows(rootNode.getQuery(), function (err, rows) {
                assert.ifError(err);
                rows.forEach(function (row) {
                    assert.ok(typeof row.cartodb_id === 'number');
                    assert.ok(typeof row.the_geom === 'string');
                });
                return done();
            });
        });
    });

});<commit_msg>lint stuff...<commit_after>'use strict';

var assert = require('assert');
var testHelper = require('../helper');


describe('closest', function () {

    var QUERY_SOURCE = 'select * from airbnb_rooms';
    var QUERY_TARGET = 'select * from atm_machines';

    var analysisDefinition = {
        type: 'closest',
        params: {
            source: {
                type: 'source',
                params: {
                    query: QUERY_SOURCE
                }
            },
            target: {
                type: 'source',
                params: {
                    query: QUERY_TARGET
                }
            },
            responses: 2,
            category: 'bank'
        }
    };

    it('basic CLOSEST test', function (done) {
        testHelper.createAnalyses(analysisDefinition, function (err, closest) {

            assert.ifError(err);

            var rootNode = closest.getRoot();

            testHelper.getRows(rootNode.getQuery(), function (err, rows) {
                assert.ifError(err);
                rows.forEach(function (row) {
                    assert.ok(typeof row.cartodb_id === 'number');
                    assert.ok(typeof row.the_geom === 'string');
                });
                return done();
            });
        });
    });

});
{'fraction_non_alphanumeric': 0.1226923076923077, 'fraction_numerical': 0.0007692307692307692, 'mean_word_length': 1.358114233907525, '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': '1432466', 'n_tokens_mistral': 715, 'n_tokens_neox': 658, 'n_words': 139}