-
-
Notifications
You must be signed in to change notification settings - Fork 9.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
Addon-docs: Add jest-transform.js to convert .mdx => .js for storyshots #7330
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://monorepo-git-fork-danielknell-jest-transform.storybook.now.sh |
Wow awesome first contribution @danielknell ! @shilman are you looking at merging this? |
@ndelangen absolutely. the source repo seems to have disappeared, so i'll need to resurrect the changes in a new branch & test them. but this is def going in. |
|
${result} | ||
`; | ||
|
||
return babel.process(result, filename, config, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't work with custom babel-jest transformer (like the one we have in our own repo), you may want to borrow the approach from injectFileName
instead
|
What's blocking this from merging? Is there any way I could help? I've started writing stories in MDX and not being able to snapshot test them is blocking me on a few things. |
@Aendrew This is going into 5.3 and we're in the process of releasing 5.2 right now. We'll work through the 5.3 PRs as soon as that's out. I'll let you know if there's anything that can expedite it after 5.2 is out. Thanks! |
As a stop gap if you save the transform file locally in the project and change the reference to a relative path you can use it now, that's what my project is doing. See the linked issue for details. |
Just a note, I'm intermittently running into abbr/deasync#55 when using this code in Node 10.16.2 on OS X 10.14.6, I think it's due to You can remove the dependency on |
Cannot wait for this! |
replaced with this PR: #8189 Because this PR is without a repo now for some reason. |
Issue: #7223
What I did
Wrote a jest transform for mdx files.
How to test
add the following to your jest config:
and run jest in a project with storyshots setup and MDX stories.
might need some additional work for things like vue/etc of which i am clueless.