Files
orca/src/main/updater-test-module-loader.test.ts
T
mirror 34fa2cd5ca
Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
source snapshot 2026-09-02
2026-09-02 02:03:16 +08:00

33 lines
1.1 KiB
TypeScript

import { setTimeout as sleep } from 'node:timers/promises'
import { afterAll, describe, expect, it, vi } from 'vitest'
import { loadUpdaterModule } from './updater-test-module-loader'
// Why: this pair depends on running in file order — the first test starts an import it never awaits,
// standing in for a test whose `await loadUpdaterModule()` outran `testTimeout`, and the second test
// is the later test the continuation used to land in.
describe('updater module loader', () => {
let outcome: Promise<string> = Promise.resolve('not started')
afterAll(() => {
vi.doUnmock('./updater')
vi.resetModules()
})
it('starts an import that outlives the test that asked for it', () => {
vi.resetModules()
vi.doMock('./updater', async () => {
await sleep(500)
return { setupAutoUpdater: () => {} }
})
outcome = loadUpdaterModule().then(
() => 'handed the module over',
(error: Error) => error.message
)
})
it('refuses to hand the module to a test that already ended', async () => {
await expect(outcome).resolves.toContain('resolved after that test ended')
})
})