Adds artist names tests
Diff
parser.js | 1 +
test/parser_test.js | 9 +++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
@@ -1,3 +1,4 @@
const TS_REGEX = /((\d{1,2}:)?\d{1,2}:\d{1,2})/;
var filterTimestamp = function(line) {
@@ -1,3 +1,4 @@
var assert = require('assert');
var parser = require('../parser');
@@ -8,11 +9,17 @@
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');
});
});
});