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

feat(storybook): add support for basic test-runner configuration #11101

Merged
merged 1 commit into from Sep 27, 2022
Merged

feat(storybook): add support for basic test-runner configuration #11101

merged 1 commit into from Sep 27, 2022

Conversation

Djiit
Copy link
Contributor

@Djiit Djiit commented Jul 11, 2022

Added support to generate storybook test-runner target (https://storybook.js.org/docs/react/writing-tests/test-runner).

Related Issue(s)

Fixes #11047

@vercel
Copy link

vercel bot commented Jul 11, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Sep 27, 2022 at 8:43AM (UTC)

@Djiit Djiit changed the title feat(storybook): addsupport for basic test-runner configuration feat(storybook): add support for basic test-runner configuration Jul 11, 2022
@mandarini mandarini self-assigned this Jul 12, 2022
@mandarini
Copy link
Member

Looks good in general! Once you mark this as ready, I'll add my comments! Thank you so much for this PR @Djiit !! :) :)

@mandarini mandarini self-requested a review July 12, 2022 08:46
@Djiit Djiit marked this pull request as ready for review September 24, 2022 07:33
@Djiit
Copy link
Contributor Author

Djiit commented Sep 24, 2022

@mandarini Thanks, please add any comments, I'll work on it asap :)

@mandarini
Copy link
Member

Hey @Djiit ! Thank you so much for this PR! I made some changes, and I'll merge, if that's ok with you! :)

Changes I made:

  1. Changed version of test-runner to the latest, so that it supports Jest 28
  2. Added the generator option to the react and the angular packages, too, so that it shows up when someone runs nx g @nrwl/react:storybook-configuration and nx g @nrwl/angular:storybook-configuration, too, and not just when they are invoking the nrwl/storybook package generator. (AMA about this if it's unclear)
  3. Rebased your branch with latest master and squashed commits (you had merged master into your branch - we prefer rebase to keep things cleaner)

Other than that, all was perfect!

Thank you so so much for contributing!!!

@mandarini mandarini enabled auto-merge (squash) September 26, 2022 10:25
@mandarini
Copy link
Member

Oh, I do have one small request! Can you change the PR description, and describe in a sentence (no more than 10-20 words) what you did? eg. added support to generate test-storybook target using test-runner, and a link to the relevant Storybook docs (test-runner docs or what not)? Thank you so much! This helps us later keep better track of what PRs do, and update any docs!!

@Djiit Djiit changed the title feat(storybook): add support for basic test-runner configuration added support to generate storybook test-runner target (https://storybook.js.org/docs/react/writing-tests/test-runner) Sep 26, 2022
@Djiit Djiit changed the title added support to generate storybook test-runner target (https://storybook.js.org/docs/react/writing-tests/test-runner) feat(storybook): add support for basic test-runner configuration Sep 26, 2022
@Djiit
Copy link
Contributor Author

Djiit commented Sep 26, 2022

Here you are :) Feel free to ping me if you need more edits. Thanks for all the work!

@mandarini mandarini merged commit 2f91d96 into nrwl:master Sep 27, 2022
@Djiit Djiit deleted the add-testrunner-config branch October 6, 2022 07:28
@gfohl
Copy link

gfohl commented Jan 13, 2023

@Djiit @mandarini hello thanks for doing this! How would I go about using this and adding test-runner to a project? Thanks!

@mandarini
Copy link
Member

Hi @gfohl !

---> https://nx.dev/packages/storybook/generators/configuration#configuretestrunner

@gfohl
Copy link

gfohl commented Jan 13, 2023

Hi @gfohl !

---> https://nx.dev/packages/storybook/generators/configuration#configuretestrunner

THanks @mandarini, one more quick question, can I add this to an existing lib that has storybook already setup?

@mandarini
Copy link
Member

You can try generating storybook configuration for that library again, yes. not sure if it will add the target. if it doesn't, try adding it in a new library, and then copy the task from project.json

@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Storybook test-runner
3 participants