{"size": 771, "ext": "js", "max_stars_repo_path": "server/songs.test.js", "max_stars_repo_name": "klwjack/sentiNote", "max_stars_repo_stars_event_min_datetime": "2017-03-28T19:49:17.000Z", "max_stars_repo_stars_event_max_datetime": "2018-08-06T09:56:33.000Z", "max_issues_repo_path": "server/songs.test.js", "max_issues_repo_name": "klwjack/sentiNote", "max_issues_repo_issues_event_min_datetime": "2017-03-14T22:56:27.000Z", "max_issues_repo_issues_event_max_datetime": "2017-04-05T15:17:04.000Z", "max_forks_repo_path": "server/songs.test.js", "max_forks_repo_name": "klwjack/sentiNote", "max_forks_repo_forks_event_min_datetime": "2017-03-28T18:47:19.000Z", "max_forks_repo_forks_event_max_datetime": "2019-01-31T17:00:11.000Z"}
{"max_stars_count": 5, "max_issues_count": 53, "max_forks_count": 4, "avg_line_length": 24.8709677419, "max_line_length": 86, "alphanum_fraction": 0.6083009079}
const request = require('supertest');
const {expect} = require('chai');
const chai = require('chai');
chai.use(require('chai-string'));
const app = require('./start');

describe('/api/songs', () => {

	it('gets response for song', (done) => {
		request(app)
			.post('/api/songs')
			.then((response) => {
				expect(200);
				expect(response.text).to.equal('Sorry, We don\'t have lyrics for this song yet.');
				done();
			});

	});

	it('gets correct lyrics for a song', function(done) {
		request(app)
			.post('/api/songs')
			.send({song_artist: 'Whitney Houston', song_title: 'I Will Always Love You'})
			.then((response) => {
				expect(response.text).to.be.a('string');
				expect(response.text).to.startsWith('\nIf I should stay');
				done();
			});
	});
});
