Skip to content

Conversation

@just-boris
Copy link
Member

@just-boris just-boris commented Jul 27, 2025

Issue #, if available:

Description of changes:

Follow up for #77, some compatibility fixes with the old code

  1. Add extraExports option to allow non-wrapper class export, for example createWrapper function
  2. Support multiple method signatures

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Jul 27, 2025

Codecov Report

❌ Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.04%. Comparing base (3913223) to head (5b2b6c1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/test-utils-new/extractor.ts 96.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
+ Coverage   91.96%   92.04%   +0.07%     
==========================================
  Files          15       15              
  Lines         909      918       +9     
  Branches      265      273       +8     
==========================================
+ Hits          836      845       +9     
  Misses         73       73              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


export interface TestUtilsVariantOptions {
root: string;
extraExports?: Array<string>;
Copy link
Member Author

Choose a reason for hiding this comment

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

Extra exports could be different for DOM and selectors code, this is why it is a separate config for each

defaultValue: getDefaultValue(extractDeclaration(parameter)),
};
}),
inheritedFrom: getInheritedFrom(declaration, className),
Copy link
Member Author

@just-boris just-boris Jul 27, 2025

Choose a reason for hiding this comment

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

Changed fields order to maintain compatibility with previous snapshot tests

@just-boris just-boris marked this pull request as ready for review July 27, 2025 22:20
@just-boris just-boris requested a review from a team as a code owner July 27, 2025 22:20
@just-boris just-boris requested review from johannes-weber and removed request for a team July 27, 2025 22:20
const declaration = extractDeclaration(property);
const declaration = property.valueDeclaration;
if (!declaration) {
throw new Error(`Unexpected member on ${className}${property.getName()}`);
Copy link
Member Author

Choose a reason for hiding this comment

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

This line is not covered in tests. Because typescript says valueDeclaration could be undefined, but it always exists in our cases

@just-boris just-boris added this pull request to the merge queue Jul 28, 2025
Merged via the queue into main with commit f59e2af Jul 28, 2025
35 checks passed
@just-boris just-boris deleted the allow-default-export branch July 28, 2025 13:23
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

Successfully merging this pull request may close these issues.

2 participants