fix: remove unnecessary abort opportunity

This commit is contained in:
Nolan Lawson 2024-03-18 22:16:25 -07:00
parent afdd2d3e6a
commit 586bc0aee2
2 changed files with 3 additions and 7 deletions

View File

@ -43,10 +43,6 @@ export async function checkForUpdates (db, dataSource, signal) {
}
export async function loadDataForFirstTime (db, dataSource, signal) {
/* istanbul ignore else */
if (import.meta.env.MODE === 'test') {
await abortOpportunity() // the fetch will error if the signal is aborted
}
let [eTag, emojiData] = await getETagAndData(dataSource, signal)
if (!eTag) {

View File

@ -68,17 +68,17 @@ describe('database timing tests', () => {
{
testName: 'basic',
dataSource: ALL_EMOJI,
maxExpectedAbortOpportunityCount: secondLoad ? (dataChanged ? 6 : 5) : 5
maxExpectedAbortOpportunityCount: secondLoad ? (dataChanged ? 6 : 5) : 4
},
{
testName: 'misconfigured etag',
dataSource: ALL_EMOJI_MISCONFIGURED_ETAG,
maxExpectedAbortOpportunityCount: secondLoad ? 5 : 5
maxExpectedAbortOpportunityCount: secondLoad ? 5 : 4
},
{
testName: 'no etag',
dataSource: ALL_EMOJI_NO_ETAG,
maxExpectedAbortOpportunityCount: secondLoad ? 6 : 6
maxExpectedAbortOpportunityCount: secondLoad ? 6 : 5
}
]
scenarios.forEach(({ testName, dataSource, maxExpectedAbortOpportunityCount }) => {