<commit_before>'use strict'

var lfmAPI = require('../modules/lfmAPI.js')

describe('Module for making requests to Last.fm API', function () {
    describe('artist.getInfo', function () {
        it('gets info about given artist', function (done) {
            lfmAPI.artist.getInfo('Train', function (artistInfo) {
                expect(artistInfo.artist.name).toEqual('Train');
                done();
            });
        });
    });
    describe('artist.getSimilar', function () {
        it('gets similar artists', function (done) {
            lfmAPI.artist.getSimilar('Train', function (artists) {
                expect(artists.similarartists.artist.length).toBeGreaterThan(0);
                done();
            });
        });
    });
    describe('track.getSimilar', function () {
        it('gets info about track', function (done) {
            lfmAPI.track.getInfo('Band of Sculls', "You're Not Pretty But You Got It Goin' On", function (trackInfo) {
                expect(trackInfo.track.name).toEqual("You're Not Pretty But You Got It Goin' On");
                done();
            });
        });
    });
});
<commit_msg>Add tests for new API requests<commit_after>'use strict'

var lfmAPI = require('../modules/lfmAPI.js')

describe('Module for making requests to Last.fm API', function () {
    describe('artist.getInfo', function () {
        it('gets info about given artist', function (done) {
            lfmAPI.artist.getInfo('Train', function (artistInfo) {
                expect(artistInfo.artist.name).toEqual('Train');
                done();
            });
        });
    });
    describe('artist.getSimilar', function () {
        it('gets similar artists', function (done) {
            lfmAPI.artist.getSimilar('Train', function (artists) {
                expect(artists.similarartists.artist.length).toBeGreaterThan(0);
                done();
            });
        });
    });
    describe('track.getInfo', function () {
        it('gets info about track', function (done) {
            lfmAPI.track.getInfo('Band of Sculls', "You're Not Pretty But You Got It Goin' On", function (trackInfo) {
                expect(trackInfo.track.name).toEqual("You're Not Pretty But You Got It Goin' On");
                done();
            });
        });
    });
    describe('downloadFullPage', function () {
        it('downloads full Last.fm page', function (done) {
            lfmAPI.downloadFullPage('http://www.last.fm/music/Natalie+Imbruglia/_/Torn', function (body) {
                expect(body.length).toBeGreaterThan(0);
                done();
            });
        });
    });
    describe('artist.getTopTracks', function () {
        it('gets top tracks for given artist', function (done) {
            lfmAPI.artist.getTopTracks('R.E.M.', '1', function (tracks) {
                expect(tracks.toptracks.track[0].name).toEqual('Losing My Religion');
                done();
            });
        });
    });
});

{'fraction_non_alphanumeric': 0.1505557426743011, 'fraction_numerical': 0.001684068710003368, 'mean_word_length': 2.096976016684046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7349142', 'n_tokens_mistral': 859, 'n_tokens_neox': 820, 'n_words': 178}