Added tests for id3v2, added sample data.
This commit is contained in:
@@ -84,10 +84,12 @@ ID3File.prototype.getTags = function getTags(version) {
|
||||
var ID3v2_ALIAS = exports.ID3v2_ALIAS = {
|
||||
"title" : ["TIT2", "TT2"],
|
||||
"artist" : ["TPE1", "TP1"],
|
||||
"albumartist" : ["TPE2", "TP2"],
|
||||
"album" : ["TALB", "TAL"],
|
||||
"year" : ["TYER", "TYE"],
|
||||
"comment": ["COMM", "COM"],
|
||||
"track" : ["TRCK", "TRK"],
|
||||
"disk" : ["TPOS", "TPA"],
|
||||
"genre" : ["TCON", "TCO"],
|
||||
"picture": ["APIC", "PIC"],
|
||||
"lyrics" : ["USLT", "ULT"]
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
var assert = require('assert'),
|
||||
id3 = require('../lib/id3'),
|
||||
fs = require('fs');
|
||||
|
||||
var audioFile = fs.readFileSync('sample3v2.mp3');
|
||||
var id3v2 = new id3(audioFile);
|
||||
|
||||
id3v2.parse();
|
||||
|
||||
assert.equal(id3v2.get('title'),'Home', 'title is not correct');
|
||||
assert.equal(id3v2.get('artist'), 'Explosions In The Sky', 'artist is not correct');
|
||||
assert.equal(id3v2.get('albumartist'), 'Soundtrack', 'album artist is not correct');
|
||||
assert.equal(id3v2.get('album'), 'Friday Night Lights [Original Movie Soundtrack]', 'album is not correct');
|
||||
assert.equal(id3v2.get('year'), 2004, 'year is not correct');
|
||||
assert.equal(id3v2.get('track'),'5','track is not correct');
|
||||
assert.equal(id3v2.get('disk'),'1/1', 'disk is not correct');
|
||||
assert.equal(id3v2.get('genre'),'Soundtrack', 'genre is not correct');
|
||||
assert.equal(id3v2.get('picture').data.length, 80938, 'picture length is not correct');
|
||||
Reference in New Issue
Block a user