This happens because the test runs both inside node and figma. Currently I am disabling it by creating a setup file that creates a dummy proxy for the figma global.
if (typeof globalThis.figma === 'undefined') {
;(globalThis as any).figma = new Proxy(
{},
{
get: (target, prop) => {
if (!(prop in target)) {
target[prop] = new Proxy(() => {}, {
apply: () => undefined,
get: () => () => {}, // return no-op function for any method
})
}
return target[prop]
},
},
)
}
This happens because the test runs both inside node and figma. Currently I am disabling it by creating a setup file that creates a dummy proxy for the figma global.