Skip to content

fix: manualMockRoot in projects#508

Merged
9aoy merged 1 commit intomainfrom
fix-projects-mock
Aug 26, 2025
Merged

fix: manualMockRoot in projects#508
9aoy merged 1 commit intomainfrom
fix-projects-mock

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Aug 26, 2025

Summary

fix manualMockRoot in projects, use project.rootPath instead of context.rootPath.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings August 26, 2025 06:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in the manualMockRoot configuration for projects where it was incorrectly using the global context root path instead of the project-specific root path. The fix ensures that manual mocks are resolved relative to each project's own directory structure rather than the workspace root.

  • Updates the mock root path resolution to use project-specific rootPath instead of global context.rootPath
  • Extracts testEnvironment and rootPath from the project configuration for cleaner access
  • Adds test coverage to verify the manual mocking functionality works correctly with the fix

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/core/src/core/plugins/basic.ts Fixed manualMockRoot path resolution and extracted project-specific variables
e2e/projects/fixtures/packages/node/test/mockFs.test.ts Added test case for filesystem mocking functionality
e2e/projects/fixtures/packages/node/src/readSomeFile.ts Added utility function for reading files in test scenarios
e2e/projects/fixtures/packages/node/mocks/fs.js Added manual mock for Node.js fs module using memfs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@netlify
Copy link
Copy Markdown

netlify bot commented Aug 26, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 4c7c39c
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68ad53e2a9ddf60008733f45
😎 Deploy Preview https://deploy-preview-508--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@9aoy 9aoy merged commit f9955bb into main Aug 26, 2025
17 checks passed
@9aoy 9aoy deleted the fix-projects-mock branch August 26, 2025 07:00
@9aoy 9aoy mentioned this pull request Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants