test(desktop): preserve native transition error identity

This commit is contained in:
winewill committed 2026-10-19 17:01:48 +08:00
1 parent 7f5007bca4
commit 798f002b19
1 file changed
+3 -2
+3 -2
View File
@@ -61,8 +61,9 @@ it('rejects a stalled native transition and allows a later attempt to complete',
it('releases native listeners when requesting the transition throws', async () => {
vi.useFakeTimers()
const f = setup()
f.window.setFullScreen.mockImplementation(() => { throw new Error('native window unavailable') })
await expect(f.prepare()).rejects.toThrow('native window unavailable')
const nativeError = new Error('native window unavailable')
f.window.setFullScreen.mockImplementation(() => { throw nativeError })
await expect(f.prepare()).rejects.toBe(nativeError)
expect(f.window.eventNames()).toEqual([])
expect(vi.getTimerCount()).toBe(0)
})