Improvements to persisted state migration (#2098)
* Fix session email/emailConfirmed types, update usage for safer access * Handle fallback better, better errors * Better handling, add test * Add test for default data * Remove fallback, not needed, update logs
This commit is contained in:
parent
a915a57b10
commit
3c8036587e
9 changed files with 48 additions and 30 deletions
13
src/state/persisted/__tests__/legacy.test.ts
Normal file
13
src/state/persisted/__tests__/legacy.test.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import {expect, test} from '@jest/globals'
|
||||
|
||||
import {transform} from '#/state/persisted/legacy'
|
||||
import {defaults, schema} from '#/state/persisted/schema'
|
||||
|
||||
test('defaults', () => {
|
||||
expect(() => schema.parse(defaults)).not.toThrow()
|
||||
})
|
||||
|
||||
test('transform', () => {
|
||||
const data = transform({})
|
||||
expect(() => schema.parse(data)).not.toThrow()
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue