Skip to content

Commit d580e1e

Browse files
committed
wip
1 parent e97d2c7 commit d580e1e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

packages/signals/signals/src/lib/storage/__tests__/web-storage.test.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ describe('WebStorage', () => {
3434

3535
webStorage.setItem(
3636
key,
37-
// @ts-ignore
38-
undefined
37+
// @ts-ignore - intentational non-serializable value
38+
BigInt(1)
3939
)
4040

41-
const result = webStorage.getItem(key)
42-
43-
expect(result).toBeUndefined()
44-
expect(consoleWarnSpy).toHaveBeenCalledTimes(1)
41+
expect(consoleWarnSpy).toHaveBeenCalledWith(
42+
'Storage set error',
43+
expect.any(Object),
44+
expect.any(Error)
45+
)
4546
})
4647

4748
it('should handle JSON parsing errors gracefully when retrieving', () => {
@@ -54,7 +55,11 @@ describe('WebStorage', () => {
5455
const result = webStorage.getItem(key)
5556

5657
expect(result).toBeUndefined()
57-
expect(consoleWarnSpy).toHaveBeenCalledTimes(1)
58+
expect(consoleWarnSpy).toHaveBeenCalledWith(
59+
'Storage retrieval error',
60+
expect.any(Object),
61+
expect.any(Error)
62+
)
5863
})
5964
})
6065
})

0 commit comments

Comments
 (0)