1
0
mirror of synced 2026-05-22 22:53:20 +00:00
Files
music-metadata/test/test-unknownencoding.ts
T
2022-02-27 15:27:40 +01:00

28 lines
1.0 KiB
TypeScript

import {assert} from 'chai';
import path from 'node:path';
import * as mm from '../lib/index.js';
import { samplePath } from './util.js';
const t = assert;
it("should be able to read metadata with unknown encoding", () => {
const filename = 'bug-unkown encoding.mp3';
const filePath = path.join(samplePath, filename);
return mm.parseFile(filePath).then(result => {
t.strictEqual(result.common.title, '808', 'title');
t.strictEqual(result.common.artist, 'Benga', 'artist');
t.strictEqual(result.common.albumartist, 'Benga', 'albumartist');
t.strictEqual(result.common.album, 'Phaze One', 'album');
t.strictEqual(result.common.year, 2010, 'year');
t.strictEqual(result.common.track.no, 4, 'track no');
t.strictEqual(result.common.track.of, 8, 'track of');
t.strictEqual(result.common.genre[0], 'Dubstep', 'genre');
t.strictEqual(result.common.picture[0].format, 'image/jpeg', 'picture format');
t.strictEqual(result.common.picture[0].data.length, 6761, 'picture length');
});
});