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

25 lines
898 B
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 read utf16bom (big endian) encoded metadata correctly', () => {
const filename = 'bug-utf16bom-encoding.mp3';
const filePath = path.join(samplePath, filename);
return mm.parseFile(filePath).then(result => {
t.equal(result.common.title, 'It\'s All Over You Know', 'title');
t.equal(result.common.artist, 'The Apers', 'artist');
t.deepEqual(result.common.artists, ['The Apers'], 'artist');
t.equal(result.common.albumartist, 'The Apers', 'albumartist');
t.equal(result.common.album, 'Reanimate My Heart', 'album');
t.equal(result.common.year, 2007, 'year');
t.deepEqual(result.common.track, {no: 1, of: null}, 'track');
t.deepEqual(result.common.genre, ['Punk Rock'], 'genre');
});
});