mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-03-17 00:31:40 +03:00
Add svgjs and testing with fake dom
This commit is contained in:
21
test/visualSegments.test.ts
Normal file
21
test/visualSegments.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
//@ts-ignore
|
||||
import { createSVGWindow } from "svgdom";
|
||||
import { registerWindow } from "@svgdotjs/svg.js";
|
||||
|
||||
import { toSVG } from "../src/utils/visualUtils";
|
||||
|
||||
beforeAll(() => {
|
||||
const window = createSVGWindow();
|
||||
registerWindow(window, window.document)
|
||||
})
|
||||
|
||||
test("Visual Segment SVG converter", async () => {
|
||||
toSVG([{
|
||||
time: 0,
|
||||
bounds: [[0, 0], [25, 0], [25, 40], [0, 30]],
|
||||
smooth: false,
|
||||
curve: "linear",
|
||||
color: "#000000",
|
||||
}]);
|
||||
});
|
||||
Reference in New Issue
Block a user