From 117f9d8f7d616cb90b49b1eedca9e423b01b705e Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Tue, 26 May 2026 00:49:13 +0000 Subject: [PATCH] [Tests] Remove redundant filesystem mocks in stage-file.test.ts Remove unused mocks for readFile and fileSize in stage-file.test.ts. These mocks were redundant as the production code in stage-file.ts uses Buffer operations rather than disk access. --- .../app/src/cli/services/bulk-operations/stage-file.test.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/app/src/cli/services/bulk-operations/stage-file.test.ts b/packages/app/src/cli/services/bulk-operations/stage-file.test.ts index b342a7bf52a..3a79e4ec5fd 100644 --- a/packages/app/src/cli/services/bulk-operations/stage-file.test.ts +++ b/packages/app/src/cli/services/bulk-operations/stage-file.test.ts @@ -1,18 +1,14 @@ import {stageFile} from './stage-file.js' import {adminRequestDoc} from '@shopify/cli-kit/node/api/admin' -import {readFile, fileSize} from '@shopify/cli-kit/node/fs' import {fetch} from '@shopify/cli-kit/node/http' import {describe, test, expect, vi, beforeEach} from 'vitest' vi.mock('@shopify/cli-kit/node/api/admin') vi.mock('@shopify/cli-kit/node/session') -vi.mock('@shopify/cli-kit/node/fs') vi.mock('@shopify/cli-kit/node/http') describe('stageFile', () => { const mockSession = {token: 'test-token', storeFqdn: 'test-store.myshopify.com'} - const mockFileContents = '{"id":"gid://shopify/Product/123","title":"Test"}' - const mockFileSize = 52 const mockUploadUrl = 'https://storage.googleapis.com/test-bucket/test-file' const mockResourceUrl = 'tmp/staged-uploads/test-resource.jsonl' @@ -35,8 +31,6 @@ describe('stageFile', () => { let formDataAppendSpy: ReturnType beforeEach(() => { - vi.mocked(readFile).mockResolvedValue(Buffer.from(mockFileContents)) - vi.mocked(fileSize).mockResolvedValue(mockFileSize) vi.mocked(fetch).mockResolvedValue({ ok: true, text: vi.fn().mockResolvedValue(''),