generated from egoist/ts-lib-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(lyrics): add test for parseLrc util
- Loading branch information
1 parent
d25e2db
commit 0714888
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { describe, expect, test } from "vitest"; | ||
import { parseLrc } from "./lyrics"; | ||
|
||
describe("parseLrc", () => { | ||
const lrc = ` | ||
[00:00.000] 作词 : James Alyn Wee/Kasidej Hongladaromp | ||
[00:01.000] 作曲 : James Alyn Wee/Kasidej Hongladaromp | ||
[00:28.836] I'm just laying on the floor again`; | ||
|
||
test("Parse raw lrc to [[time, text]] format", () => { | ||
expect(parseLrc(lrc)).toEqual([ | ||
[0, "作词 : James Alyn Wee/Kasidej Hongladaromp"], | ||
[1, "作曲 : James Alyn Wee/Kasidej Hongladaromp"], | ||
[28.836, "I'm just laying on the floor again"], | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters