[Tests] Remove filesystem mocks in bundle-size.test.ts#7548
[Tests] Remove filesystem mocks in bundle-size.test.ts#7548gonzaloriestra wants to merge 1 commit into
Conversation
Refactor bundle-size.test.ts to use real filesystem operations in temporary directories instead of mocking the fs module.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Description
This PR refactors
packages/app/src/cli/services/build/bundle-size.test.tsto replace global filesystem mocks (vi.mock('@shopify/cli-kit/node/fs')) with real filesystem operations usinginTemporaryDirectoryandwriteFile. This makes the tests more reliable and realistic by testing against the actual disk.Changes
vi.mock('@shopify/cli-kit/node/fs').inTemporaryDirectory.writeFileto create test files on disk.vi,readFile).Duplicate check
git log --grep="\[Tests\]" --oneline -n 100andgit log --grep="Jules" --oneline -n 100.[Tests] Remove filesystem mocks in execute-bulk-operation.test.ts.bundle-size.test.ts) and addresses a different set of test cases related to bundle size calculation.Verification
pnpm --filter @shopify/app vitest run src/cli/services/build/bundle-size.test.ts(all passed).pnpm --filter @shopify/app lint(passed).pnpm knip --workspace packages/app(passed).pnpm --filter @shopify/app type-check(passed).pnpm --filter @shopify/app vitest run(all 2188 tests passed).PR created automatically by Jules for task 6938643062223810454 started by @gonzaloriestra