{"size": 1492, "ext": "js", "max_stars_repo_path": "test/parser.spec.js", "max_stars_repo_name": "GTCMT/DataToMusicAPI", "max_stars_repo_stars_event_min_datetime": "2016-04-04T20:20:26.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-15T02:15:35.000Z", "max_issues_repo_path": "test/parser.spec.js", "max_issues_repo_name": "AndrejHronco/DataToMusicAPI", "max_issues_repo_issues_event_min_datetime": "2016-02-22T00:38:30.000Z", "max_issues_repo_issues_event_max_datetime": "2018-02-15T17:39:39.000Z", "max_forks_repo_path": "test/parser.spec.js", "max_forks_repo_name": "GTCMT/DataToMusicAPI", "max_forks_repo_forks_event_min_datetime": "2016-04-06T13:54:57.000Z", "max_forks_repo_forks_event_max_datetime": "2018-03-03T00:34:39.000Z"}
{"max_stars_count": 29, "max_issues_count": 17, "max_forks_count": 4, "avg_line_length": 30.4489795918, "max_line_length": 74, "alphanum_fraction": 0.523458445}
describe('parser', function () {
    var p = dtm.parser;
    var mockCsv =
        'foo, bar, baz\n' +
        '123, 456.78, hey\n' +
        '789, 444.44, hoo';
    var mockJson = p.csvToJson(mockCsv);

    describe('csvToJson', function () {
        it('should return an object', function () {
            expect(typeof(p.csvToJson(mockCsv))).toBe('object');
        });

        it('should have 2 dict objects (rows)', function () {
            expect(p.csvToJson(mockCsv).length).toBe(2);
        });
    });

    describe('csvToCols', function () {
        it('should have 3 columns', function () {
            expect(Object.keys(p.csvToCols(mockCsv)).length).toBe(3);
        });

        it('should work', function () {
            expect(p.csvToCols(mockCsv)['foo']).toEqual([123, 789]);
            expect(p.csvToCols(mockCsv)['bar']).toEqual([456.78, 444.44]);
            expect(p.csvToCols(mockCsv)['baz']).toEqual(['hey', 'hoo']);
        });
    });


    describe('getSize', function () {
        it('should return a 2 value array', function () {
            expect(p.getSize(mockJson).length).toBe(2);
        });

        it('should return a column value of 3', function () {
            expect(p.getSize(mockJson)[0]).toBe(3);
        });

        it('should return a row value of 2', function () {
            expect(p.getSize(mockJson)[1]).toBe(2);
        });
    });

    describe('valueTypes', function () {
//        console.log(p.valueTypes(mockJson[1]));
    });
});