-
Notifications
You must be signed in to change notification settings - Fork 72
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
Refactor: Improve internal code #378
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #378 +/- ##
===========================================
+ Coverage 80.64% 96.10% +15.46%
===========================================
Files 12 14 +2
Lines 217 257 +40
Branches 56 69 +13
===========================================
+ Hits 175 247 +72
+ Misses 42 10 -32 ☔ View full report in Codecov by Sentry. |
- Added Jest configuration file (jest.config.js) to project root. - Created a new test file (jest-playwright.test.ts) in the src/config directory. - This commit introduces the necessary setup for running tests using Jest Playwright. - The Jest configuration file allows customization of Jest's behavior. - The new test file will be used for writing tests using the Jest Playwright library. - This addition enhances the project's testing capabilities and enables UI testing with Playwright.
This commit adds a new test file for testing the hooks functionality in Playwright.
…ecessary conditional The makePlayTest function in the transformCsf file has been simplified to remove an unnecessary conditional statement. The metaOrStoryPlay parameter is now optional, indicated by the use of the "?" symbol. This change was made to improve code readability and reduce complexity.
The TestRunnerConfig interface in the hooks.ts file now includes an optional tags property. This property allows users to include, exclude, or skip specific tags when running tests. The tags are defined as annotations in the story or meta. This change provides more flexibility and control over test execution based on specific tags.
- Updated the entry configuration in tsup.config.ts to include all JavaScript and TypeScript files in the src directory, excluding declaration files and test files. - This change was made to ensure that only the necessary source files are included in the build process, improving build performance and reducing bundle size.
Hey @bryanjtc! Thank you so much for all these contributions! I finally have time to go through them, and will start reviewing, adding work on top of and responding to them. |
🚀 PR was released in |
Pull Request Summary
Description:
This pull request introduces several changes and additions to the codebase. These changes enhance the codebase and improve error handling and type checking. Below is a detailed summary of the changes made in each file:
.github/workflows/typecheck.yml
typecheck.yml
.yarn tsc
.src/config/jest-playwright.ts
browsers
property by checking ifTEST_BROWSERS
exists.src/csf/transformCsf.ts
result
variable and assigned theinput
to it.testPrefixer
exists, and if so, performed some additional operations.result
is falsy, it's set to a null literal.src/csf/transformCsf.test.ts
transformCsf
function andprefixFunction
.src/playwright/transformPlaywright.ts
makeTitleFactory
function to ensure the returned value is always a string.src/setup-page.ts
testRunnerConfig
exists before calling thedefaultPrepare
function.src/test-storybook.ts
src/util/getCliOptions.test.ts
src/util/getCliOptions.ts
src/util/getParsedCliOptions.test.ts
getParsedCliOptions
function.src/util/getParsedCliOptions.ts
src/util/getStorybookMetadata.ts
getStorybookMetadata
function to handle cases whereconfigDir
is not provided.src/util/getTestRunnerConfig.test.ts
getTestRunnerConfig
function.src/util/getTestRunnerConfig.ts
getTestRunnerConfig
function to handle cases whereconfigDir
is not provided.tsconfig.json
noEmit
to true.Changes in
jest.config.js
:moduleNameMapper
section has been included to map various '@storybook/test-runner/playwright' paths to corresponding '/playwright' paths.Additions in
src/config/jest-playwright.test.ts
:Additions in
src/playwright/hooks.test.ts
:Additions in
src/playwright/hooks.test.ts
:From #323
📦 Published PR as canary version:
0.15.3--canary.378.1843bee.0
✨ Test out this PR locally via: