fix(web): await replacement refresh coverage
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user