Skip to content

Commit

Permalink
Fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
origami-z committed May 17, 2024
1 parent 3d352bc commit ba05bc7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions vitest/setupFigmaGlobal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { populateGlobal } from "vitest/environments";
import { vi } from "vitest";
import { vi, beforeAll } from "vitest";

class ComponentNode {
height: number;
Expand All @@ -20,8 +19,9 @@ class ComponentNode {
this.height = height;
}
}
populateGlobal(global, {
figma: {

beforeAll(() => {
global.figma = {
ui: {
postMessage: vi.fn(),
},
Expand All @@ -32,6 +32,5 @@ populateGlobal(global, {
},
createComponent: () => new ComponentNode(),
createText: vi.fn(),
},
// Int32Array: vi.fn(),
};
});

0 comments on commit ba05bc7

Please sign in to comment.