[Tests] Replace filesystem mocks with real temp directories in store result tests#7982
[Tests] Replace filesystem mocks with real temp directories in store result tests#7982gonzaloriestra wants to merge 1 commit into
Conversation
…result tests
Refactor `packages/store/src/cli/services/store/execute/result.test.ts` to use `inTemporaryDirectory` and `readFile` instead of mocking `@shopify/cli-kit/node/fs`. This ensures that file operations are verified against the actual filesystem and avoids brittle mocks.
- Removed `vi.mock('@shopify/cli-kit/node/fs')`
- Updated tests to use `inTemporaryDirectory` for file output verification
- Verified that `renderSuccess` is called with the correct dynamic path
|
👋 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. |
This PR improves the test suite for the
@shopify/storepackage by removing filesystem mocks inresult.test.ts.Why this change is needed?
The automated task protocol for tests (
.agents/automated-tasks/tests.md) mandates using real files and directories in temporary directories instead of mocking the filesystem. This makes tests more robust and less coupled to implementation details of how the filesystem is accessed.How to test your changes?
CI
Checklist
pnpm lint,pnpm knip,pnpm type-check, andpnpm test:unitand they all pass.PR created automatically by Jules for task 8876345509233618617 started by @gonzaloriestra