chore(release): 版本发布 - publish v1.5.6

This commit is contained in:
ddCat
2026-09-20 05:37:38 +08:00
parent caad655e43
commit d5300bd44f
3 changed files with 18 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
import { beforeEach, describe, expect, test } from "bun:test";
import { afterEach, beforeEach, describe, expect, test } from "bun:test";
import {
DEFAULT_CANVAS_BACKGROUND_MODE,
@@ -14,8 +14,10 @@ import {
} from "../src/lib/canvas/canvas-appearance";
const values = new Map<string, string>();
let originalWindow: PropertyDescriptor | undefined;
beforeEach(() => {
originalWindow = Object.getOwnPropertyDescriptor(globalThis, "window");
values.clear();
Object.defineProperty(globalThis, "window", {
configurable: true,
@@ -29,6 +31,11 @@ beforeEach(() => {
});
});
afterEach(() => {
if (originalWindow) Object.defineProperty(globalThis, "window", originalWindow);
else Reflect.deleteProperty(globalThis, "window");
});
describe("canvas custom appearance", () => {
test("uses point grid as the default for new canvases", () => {
expect(DEFAULT_CANVAS_BACKGROUND_MODE).toBe("dots");