-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gatsby-plugin-mdx): Fix not passing file path to remark plugins #26914
Conversation
gatsby-plugin-mdx
not passing file path to remark plugins
Thanks for the PR! It looks like you've added a function that will throw an error to the test site but no corresponding tests? Can we add something that specifies this behavior, or maybe some comments for context? In general, I think the code change should be fine. |
I thought that the e2e-test site IS the test? If we revert the changes, then the test will fail. Adding some comments sounds nice! Though I also think that the error message is the context? I can still add it though if you think it'd be better :). |
Inside the cypress folder is the set of tests that run against that site. And by the comments I was thinking a note about the fact that the message appears if file paths aren't passed correctly. |
@laurieontech Got it! However though, if I understand correctly, the cypress tests are for testing the page but not the setup. The added test plugin is trying to test the setup to make sure it can read the file argument correctly as expected during build time. I'm starting to wonder if it's the right place to add the test there 🤔 ? The error message |
Ya, the challenge here is this is arguably an e2e test that is also an integration test. It impacts the build rather than the render. I think we're ok to leave it where it is but would love to add a comment in the gatsby-config file near the function explaining what the test is for. If the error message doesn't appear, or even if it does, some additional context is needed. |
@laurieontech sounds good! Just added the comments. Please have a look :) |
Thanks @kevin940726! Appreciate the fix and additional clarity. |
…atsbyjs#26914) * Fix gatsby-plugin-mdx not passing file path to remark plugins * Add comments for the test
Description
Fix a regression where
gatsby-plugin-mdx
fails to pass the file path to remark plugins.Tested both manually and using the added e2e test.
Documentation
https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#remark-plugins
Related Issues
Related to #21489