Add svgjs and testing with fake dom

This commit is contained in:
Ajay Ramachandran
2021-09-26 00:23:49 -04:00
parent 51d9edbbb4
commit 21f54eef67
4 changed files with 3102 additions and 268 deletions

View 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",
}]);
});