Closed vcmiranda closed 4 months ago
That was fast. Thanks.
Hey,
I'm trying to add a spy on localstorage.setItem and I'm facing the same issue TypeError: 'deleteProperty' on proxy: trap returned falsish for property 'setItem'
.
I'm using @happy-dom/jest-environment@14.3.9
.
Here's the test code:
jest.spyOn(localStorage, 'setItem').mockImplementationOnce(() => {
throw new Error('error');
});
Thanks !
Describe the bug When using
spyOn
in sessionStorage (vitest), the following message is displayed:'defineProperty' on proxy: trap returned falsish for property 'getItem'
To Reproduce Sample code