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

bug-fix-jest-addon-undefined-file-extension #4452

Merged
merged 1 commit into from Oct 20, 2018
Merged

bug-fix-jest-addon-undefined-file-extension #4452

merged 1 commit into from Oct 20, 2018

Conversation

ghost
Copy link

@ghost ghost commented Oct 16, 2018

Previously the code was such that the file name would always have an extension that read undefined this fixes that.

Issue:

What I did

We updated from v4.0.0-alpha.24 to v4.0.0-rc.0 and the unit tests no longer showed up for the jest addon. We dug into the code and quickly realized that the file extension will always be undefined in line 7 of the code because it isn't an object but a string.

How to test

Without this fix, see that jest test results do not show up, then update it and the test results should be available. (not sure if there were unit tests to make sure of this implementation)

Is this testable with Jest or Chromatic screenshots? No
Does this need a new example in the kitchen sink apps? No
Does this need an update to the documentation? No

Previously the code was such that the file name would always have an extension that read `undefined` this fixes that.
@storybook-safe-bot
Copy link
Contributor

Fails
🚫

PR is not labeled with one of: ["cleanup","BREAKING CHANGE","feature request","bug","documentation","maintenance","dependencies:update","dependencies","other"]

Generated by 🚫 dangerJS

@renaudtertrais
Copy link
Contributor

I am not sure to really understand the problem.
How to reproduce the issue ?
jestTestFilesOptions should be an object no ?

@ghost
Copy link
Author

ghost commented Oct 17, 2018

@renaudtertrais correct If you look at the code below

You will notice that on line 22 (https://github.com/storybooks/storybook/blob/master/addons/jest/src/index.js#L22 ) the last parameter is being sent in as a string (the file extension name).

However, on line 7 (https://github.com/storybooks/storybook/blob/master/addons/jest/src/index.js#L7) it is clearly expecting this to be an object which would make it undefined every time and the reason our tests stopped being included on the Tests tab in storybook.

Hope that explanation is a little bit more clear and gives insight to my change

Copy link
Member

@wuweiweiwu wuweiweiwu left a comment

Choose a reason for hiding this comment

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

Nice fix

@wuweiweiwu wuweiweiwu merged commit b174859 into storybookjs:master Oct 20, 2018
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.

None yet

3 participants