[Tests] Remove filesystem mocks in dev-override.test.ts#7655
[Tests] Remove filesystem mocks in dev-override.test.ts#7655gonzaloriestra wants to merge 1 commit into
Conversation
Refactor `packages/theme/src/cli/services/dev-override.test.ts` to remove filesystem mocks.
Replaced `vi.mock('@shopify/cli-kit/node/fs')` with real filesystem operations using `inTemporaryDirectory` and `writeFile` from `@shopify/cli-kit/node/fs`, and `joinPath` from `@shopify/cli-kit/node/path`.
This aligns with the project's testing standards of using real files and directories in temporary directories instead of mocking the filesystem.
|
👋 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. |
User's Goal
The goal is to update the test suite to use real file system interactions within a temporary directory instead of mocking global file system functions, adhering to the project's testing standards.
Evaluation of the Solution
Core Functionality
The patch successfully migrates the tests from using
vi.mockfor@shopify/cli-kit/node/fsto usinginTemporaryDirectoryandwriteFile. This ensures that the code under test interacts with a real (though temporary) file system, which is a more realistic and less brittle way to test file-related logic.Safety & Side Effects
Completeness
The patch correctly updates all test cases within the file. It appropriately handles dynamic path generation using
joinPathand updates error message assertions to include the dynamic paths where necessary.How to test your changes?
CI
PR created automatically by Jules for task 12302561209149859480 started by @gonzaloriestra