fix(web): await replacement refresh coverage

This commit is contained in:
2026-07-22 14:21:33 +08:00
parent 51c6fea343
commit 19f9e163e2
6 changed files with 186 additions and 26 deletions

View File

@@ -55,3 +55,35 @@ test('full and targeted refreshes supersede only when their coverage overlaps gl
assert.equal(full.signal.aborted, true)
assert.equal(newerProjectA.isCurrent(), true)
})
test('project A superseded by a failing full refresh is not considered covered', async () => {
const coordinator = createProjectRefreshCoordinator()
const projectA = coordinator.beginProject('project-a')
const full = coordinator.beginFull()
full.finish(false)
assert.equal(await projectA.waitForCoverage(), false)
})
test('only a successful replacement confirms coverage of a superseded project', async () => {
const coordinator = createProjectRefreshCoordinator()
const firstProjectA = coordinator.beginProject('project-a')
const newerProjectA = coordinator.beginProject('project-a')
newerProjectA.finish(true)
assert.equal(await firstProjectA.waitForCoverage(), true)
})
test('a successful full refresh covers every targeted request it superseded', async () => {
const coordinator = createProjectRefreshCoordinator()
const projectA = coordinator.beginProject('project-a')
const projectB = coordinator.beginProject('project-b')
const full = coordinator.beginFull()
full.finish(true)
assert.equal(await projectA.waitForCoverage(), true)
assert.equal(await projectB.waitForCoverage(), true)
})