chore(release): 版本发布 - publish v1.5.6
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user