test: restore shared Cloudflare mocks

This commit is contained in:
saltbo
2026-08-05 13:36:29 -04:00
parent 9c9ecfc69b
commit 4b58b64d38
+5 -1
View File
@@ -1,5 +1,5 @@
import { env } from 'cloudflare:workers'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { DirType } from '../../shared/constants'
import { generateId } from '../../shared/ids'
import type { CreateShareInput } from '../../shared/schemas/share'
@@ -144,6 +144,10 @@ describe('[CF] saveShareToDrive — stream copy via D1', () => {
vi.spyOn(S3Service.prototype, 'streamCopy').mockResolvedValue(undefined)
})
afterEach(() => {
vi.restoreAllMocks()
})
it('saves a single file to the target org on D1', async () => {
const db = buildDb()
const srcOrgId = generateId()