-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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: Jest MDX transform for storyshots #8189
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/storybook/monorepo/bs7viuaag |
Can't wait for this either, thanks! Maybe remove the dependency on |
Would you like to contribute to this PR @edelgado? |
@ndelangen sure thing! Thanks for the access, will submit a commit soon. |
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.
NICE!! looking very clean. would it be possible to update the documentation as well?
@shilman Absolutely! Added to both add-ons to make it easier on the users. |
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.
Thanks @edelgado, this looks great. Last request: can we add this to our monorepo somehow to test it?
@shilman what do you require? |
@ndelangen working with @Hypnosphi to get this mergeable |
@shilman looks like you're adding the transform twice, as it's already present in In my case, right before your commit, the html snapshotting went OK, but storyshots-integrity complained, probably because its algorythm doesn't know anything about mdx extension yet The other failures (vue, angular) were the same as you see now on CI UPD: I re-ran the CI tests on my commit, so that you could see the original "Storyshots Integrity" error |
@Hypnosphi I fixed the integrity error in my latest commit. However, I'm not sure what's going on with Vue/Angular. Do you have any ideas? |
@shilman not really |
@ndelangen and I were able to get angular working. Vue is not working due to a babel issue, and I've temporarily disabled it to move this forward. I'll follow up with @Aaron-Pool to see if we can get that working. Pretty sure it's more of a Vue/Babel issue than a Jest/MDX one. |
```json | ||
{ | ||
"transform": { | ||
"^.+\\.[tj]sx?$": "babel-jest", |
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.
Isn't there a pipe symbol missing: [t|j] ? As here: https://github.com/facebook/jest/tree/master/packages/babel-jest#setup
```json | ||
{ | ||
"transform": { | ||
"^.+\\.[tj]sx?$": "babel-jest", |
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.
Isn't the pipe symbol necessary? [t|j]
Issue: #7223
This replaces #7330 since that PR no longer has a repository and cannot be contributed on anymore :(
What I did
Wrote a jest transform for mdx files.
How to test
add the following to your jest config: