Skip to content
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

Don't require storyshots users to transform lodash-es #2570

Closed
tmeasday opened this issue Dec 27, 2017 · 14 comments
Closed

Don't require storyshots users to transform lodash-es #2570

tmeasday opened this issue Dec 27, 2017 · 14 comments

Comments

@tmeasday
Copy link
Member

Issue details

As part of #2558 we added a dependency on lodash-es, an uncompiled JS dependency.

This means that Jest needs to be configured to transform the file with:

  transformIgnorePatterns: ['/node_modules/(?!lodash-es/.*)'],

within each users' storyshots-using project.

Steps to reproduce

Create a storyshots project with 3.3.

tmeasday added a commit that referenced this issue Dec 27, 2017
@tmeasday
Copy link
Member Author

tmeasday commented Dec 27, 2017

Can we programmatically add to the user's jest config? Feels a little hacky, but then storyshots is pretty hacky ;)

It's probably too late in the piece to do it though :/

@tmeasday
Copy link
Member Author

cc @igor-dv @Hypnosphi

@tmeasday
Copy link
Member Author

The only other option I can think of is to use something like babel-register

shilman added a commit that referenced this issue Dec 27, 2017
@tmeasday
Copy link
Member Author

I don't think babel-register works with jest, so I think that is out.

@igor-dv
Copy link
Member

igor-dv commented Dec 27, 2017

Hmm.. Shit. I've Forgotten about people need their own jest config. Storyshots already use babel-core internally maybe we can somehow use it for that?

@tmeasday
Copy link
Member Author

It also overrides require, so maybe.. let's try some stuff.

@tmeasday
Copy link
Member Author

tmeasday commented Dec 27, 2017

This line is the place the exception comes from (it isn't clear from the stack trace):

https://github.com/storybooks/storybook/blob/79c07c727a2f5eedf34502df4207d7a6527fedf0/addons/storyshots/src/index.js#L46

@Hypnosphi
Copy link
Member

I don't think babel-register works with jest

Why?

@igor-dv
Copy link
Member

igor-dv commented Dec 27, 2017

DIdn't work for me,

@tmeasday
Copy link
Member Author

I don't think babel-register works with jest
Why?

Jest overrides require itself I guess. It doesn't seem like they are compatible.

@tmeasday
Copy link
Member Author

If we want to try and get it working with Jest we should probably follow these for insights into a non-hacky solution: jestjs/jest#4842 jestjs/jest#2205

@eddiemonge
Copy link
Contributor

This is a breaking change and is causing test failures for us

@igor-dv
Copy link
Member

igor-dv commented Dec 28, 2017

Will revert it today

@tmeasday
Copy link
Member Author

tmeasday commented Jan 2, 2018

This was fixed and released in 3.3.3

@tmeasday tmeasday closed this as completed Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants