Adds artist names tests

This commit is contained in:
Nemo 2017-06-08 02:17:10 +05:30
parent 0c03879b7d
commit 9035cbefe2
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,4 @@
/*jshint esversion: 6 */
const TS_REGEX = /((\d{1,2}:)?\d{1,2}:\d{1,2})/;
var filterTimestamp = function(line) {

View File

@ -1,3 +1,4 @@
/*jshint esversion: 6 */
var assert = require('assert');
var parser = require('../parser');
@ -8,11 +9,17 @@ Something else in the middle
1:23:11 Not the last song
`;
const TEXT_WITH_ARTIST = '12:23 Rolling Stones - Hello World';
describe('Parser', function() {
describe('parser', function() {
it('should find all timestamps', function() {
console.log(parser.parse(TEXT));
assert.equal(parser.parse(TEXT).length, 3);
});
it('should find artist names', function() {
let result = parser.parse(TEXT_WITH_ARTIST);
assert.equal(result[0].artist, 'Rolling Stones');
});
});
});