-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat: jest 28 support #154
Conversation
The Had to update the |
playwright/transform.js
Outdated
@@ -15,6 +15,6 @@ module.exports = { | |||
'@babel/preset-react', | |||
], | |||
}); | |||
return result ? result.code : src; | |||
return result ? { code: result.code } : src; |
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.
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.
Hey @andykenward thank you so much for your contribution! I added a few comments.
I am hoping we can still support both Jest versions, and the way to use Jest < 28 would be to just downgrade jest-playwright-preset
. Please check if my comments make sense, I'd love to see if there is a way to make this less breaking for the users!
Also, feel free to turn this PR into non-draft, so that it releases canary versions that you can test in your project!
Reverted some changes so we still support older Jest and Jest 28 at the same time. |
@yannbf was a canary version published? I can't find it, but I'd love to test this out in my own project. |
Hey @andykenward @IanVS I manually released this as |
A few updates from my testing rounds: Canary 0.6.0 version + Jest 28, first time running. But running again, it worked fine, same time as before ~3-4s. Canary 0.6.0 version + Jest 27 Canary 0.6.0 version + yarn resolutions + Jest 27 Overall it's looking great! Thank you so much @andykenward <3 |
I updated to the canary without changing jest, and it worked fine. But when I updated jest, I now get:
|
node: I upgraded to this canary build and jest in my project. Did an @IanVS try doing |
@andykenward for some reason I can't determine, npm is putting |
@IanVS I've set in my |
But |
I just noticed that the |
I'd say don't hold this up for my weird issue. There's at least a workaround for it. |
Hey peeps! Sorry I'll get to this as soon as I can. The week has been pretty tough so I didn't have time. Thank you so much for your patience!! |
Use storybook test-runner and `@storybook/addon-coverage` to get visual coverage report. The setup requires spinning up storybook before generating the coverage numbers. Now, we have three test scripts: - test => combined test coverage - test:unit => jest test coverage only - test:visual => story book coverage only (note: this only collect coverage on src/components) Updated coverage github action to also create/update comment which display code coverage percentage for unit, visual, and combined tests the test-runner only works with jest v27 right now. As nidhi noted in her [pr](#274), storybook will be adding support for v28 shortly (storybookjs/test-runner#154). [playwright](https://www.npmjs.com/package/playwright) library is needed in the github action for test-storybook. <img width="600" alt="Screen Shot 2022-08-03 at 4 51 03 PM" src="https://user-images.githubusercontent.com/36055303/182709211-0189bad6-e978-4f82-9ee4-ba62be350283.png"> NOTE: The report generated from `nyc` merge command may not be super accurate after some comparison between to the unit vs visual vs merge report (ex: [github issue](istanbuljs/nyc#1302)). J=SLAP-2269 & SLAP-2270 TEST=manual&auto - See that running `npm run test:visual` generates lcov report in coverage/visual folder. And the report is printed out in terminal. - See that a comment is made to the PR about the three coverage percentages. - See that coverall percentage increase without changes to tests (increased due to combined test coverage)
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.
LGTM! 💯 Perhaps we can figure out what's going wrong with Ian's setup if more users encounter this
I agree. And the solution / workaround is simple if they do. They just need to install |
Add a GH workflow to check for WCAG violations. If the check fails, the PR will be blocked from merging into main. There are some WCAG violations that we ignore, namely color contrast failures on stories where components are in a "loading" state. Using config options, that rule is disabled for those particular stories. To get the automated WCAG checks, Storybook has to be running while the `npm run wcag` command is run. Note, Jest had to be downgraded to v27 to work with `@storybook/test-runner`. But, it looks like they will be adding support for v28 shortly (storybookjs/test-runner#154), so we should be able to upgrade again soon. In the meantime, we haven't been using any features from v28, so the downgrade didn't affect any tests. Also, the Snyk checks are failing, but the new license and one of new vulnerabilities are both approved by legal in Juliann's [PR](#264 (comment)). The other new vulnerability is also introduced only through Storybook, so we wouldn't be susceptible to it. J=SLAP-2289 TEST=auto See that the check runs as expected on this PR and passes.
🚀 PR was released in |
Use storybook test-runner and `@storybook/addon-coverage` to get visual coverage report. The setup requires spinning up storybook before generating the coverage numbers. Now, we have three test scripts: - test => combined test coverage - test:unit => jest test coverage only - test:visual => story book coverage only (note: this only collect coverage on src/components) Updated coverage github action to also create/update comment which display code coverage percentage for unit, visual, and combined tests the test-runner only works with jest v27 right now. As nidhi noted in her [pr](#274), storybook will be adding support for v28 shortly (storybookjs/test-runner#154). [playwright](https://www.npmjs.com/package/playwright) library is needed in the github action for test-storybook. <img width="600" alt="Screen Shot 2022-08-03 at 4 51 03 PM" src="https://user-images.githubusercontent.com/36055303/182709211-0189bad6-e978-4f82-9ee4-ba62be350283.png"> NOTE: The report generated from `nyc` merge command may not be super accurate after some comparison between to the unit vs visual vs merge report (ex: [github issue](istanbuljs/nyc#1302)). J=SLAP-2269 & SLAP-2270 TEST=manual&auto - See that running `npm run test:visual` generates lcov report in coverage/visual folder. And the report is printed out in terminal. - See that a comment is made to the PR about the three coverage percentages. - See that coverall percentage increase without changes to tests (increased due to combined test coverage)
Add a GH workflow to check for WCAG violations. If the check fails, the PR will be blocked from merging into main. There are some WCAG violations that we ignore, namely color contrast failures on stories where components are in a "loading" state. Using config options, that rule is disabled for those particular stories. To get the automated WCAG checks, Storybook has to be running while the `npm run wcag` command is run. Note, Jest had to be downgraded to v27 to work with `@storybook/test-runner`. But, it looks like they will be adding support for v28 shortly (storybookjs/test-runner#154), so we should be able to upgrade again soon. In the meantime, we haven't been using any features from v28, so the downgrade didn't affect any tests. Also, the Snyk checks are failing, but the new license and one of new vulnerabilities are both approved by legal in Juliann's [PR](#264 (comment)). The other new vulnerability is also introduced only through Storybook, so we wouldn't be susceptible to it. J=SLAP-2289 TEST=auto See that the check runs as expected on this PR and passes.
CLOSES #99
A first pass at upgrading to Jest 28 only support.
As jest-playwright 2.0.0 has been upgraded to now support Jest 28. But it has a breaking change of no longer supporting older Jest versions.
Release Notes
Features
This release updates
jest-playwright
to version 2.0.0 which adds support for Jest 28. In order to maintain backwards compatibility with Jest 27, you might have to take a few steps in case you are installing the test runner for the first time, or if you don't keep package locks in your project.You can find more info at https://github.com/storybookjs/test-runner#jest-27-support
Version
Published prerelease version:
v0.6.0-next.0
Changelog
Release Notes
feat: jest 28 support (#154)
Features
This release updates
jest-playwright
to version 2.0.0 which adds support for Jest 28. In order to maintain backwards compatibility with Jest 27, you might have to take a few steps in case you are installing the test runner for the first time, or if you don't keep package locks in your project.You can find more info at https://github.com/storybookjs/test-runner#jest-27-support
🚀 Enhancement
🐛 Bug Fix
Authors: 2