test(chapter): PKG-CHAPTER-02 cover behavior and optional factory types

This commit is contained in:
Harvey Zhao committed 2026-09-10 22:43:01 +08:00
1 parent 701749520b
commit 12b047f9a6
17 files changed
+624 -15

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import type Artplayer from 'artplayer'
import chapter from 'artplayer-plugin-chapter'
declare const art: Artplayer
chapter()
chapter(undefined)
chapter({})
chapter({ chapters: [] })(art).update({})
const name: 'artplayerPluginChapter' = chapter()(art).name
void name
// @ts-expect-error The update object remains required.
chapter()(art).update()
// @ts-expect-error A chapter title remains a string.
chapter({ chapters: [{ start: 0, end: 1, title: 12 }] })
// @ts-expect-error null is not an options object.
chapter(null)