[Type] Enable strict schema type for setting entries (#3425)

This commit is contained in:
Chenlei Hu
2025-04-12 11:34:02 -04:00
committed by GitHub
parent c7a7397000
commit 1c41db75f8
3 changed files with 126 additions and 119 deletions

View File

@@ -189,11 +189,11 @@ describe('useSettingStore', () => {
expect(storedValue).toEqual({ foo: 'bar', nested: { value: 123 } })
})
it('should prevent mutations of retrieved objects', () => {
it('should prevent mutations of retrieved objects', async () => {
const initialValue = { foo: 'bar', nested: { value: 123 } }
// Set initial value
store.set('test.setting', initialValue)
await store.set('test.setting', initialValue)
// Get the value and try to mutate it
const retrievedValue = store.get('test.setting')
@@ -230,11 +230,11 @@ describe('useSettingStore', () => {
expect(storedValue).toEqual([1, 2, { value: 3 }])
})
it('should prevent mutations of retrieved arrays', () => {
it('should prevent mutations of retrieved arrays', async () => {
const initialArray = [1, 2, { value: 3 }]
// Set initial value
store.set('test.setting', initialArray)
await store.set('test.setting', initialArray)
// Get the value and try to mutate it
const retrievedArray = store.get('test.setting')