Skip to content

Commit

Permalink
test: add writing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
eidoriantan committed Jun 9, 2024
1 parent c7518d7 commit 8701fe9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/id3v2/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,29 @@ describe('ID3v2', function () {
])
})

it('Write unsupported frames', function () {
this.mp3tag.read({
id3v1: false,
unsupported: true
})
if (this.mp3tag.error) throw new Error(this.mp3tag.error)

this.mp3tag.save({
id3v2: { unsupported: true }
})
if (this.mp3tag.error) throw new Error(this.mp3tag.error)

this.mp3tag.read({
id3v1: false,
unsupported: true
})
if (this.mp3tag.error) throw new Error(this.mp3tag.error)

assert.deepStrictEqual(this.mp3tag.tags.v2.UNSU, [
[1, 2, 3, 4, 5]
])
})

it('Skip unsupported frames', function () {
this.mp3tag.read({ id3v1: false })
if (this.mp3tag.error) throw new Error(this.mp3tag.error)
Expand Down

0 comments on commit 8701fe9

Please sign in to comment.