Skip to content

Conversation

@just-boris
Copy link
Member

Issue #, if available:

Description of changes:

Follow up for #77

The new version does not support the most important use-case, re-exporting the classes:

export { ButtonWrapper } from './button';

Fixed now and added a unit test

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

});

test('throws error on unknown export', () => {
expect(() => buildTestUtilsProject('errors-no-wrapper-classes')).toThrow(
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 fixture existed, but was never used 🤦

return declarations[0];
}

export function printFlags(flags: number, mapping: Record<number, 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.

Not used in the final version of the code, but it was useful in local debugging to convert binary flags into readable strings

Let's keep it in the code so I will not have to remember how it is done every time

throw new Error(`Exported symbol is not a class, got ${checker.symbolToString(symbol)}`);
}

const classType = checker.getTypeAtLocation(extractDeclaration(symbol));
Copy link
Member Author

Choose a reason for hiding this comment

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

The actual fix. Replace getTypeAtLocation with getDeclaredTypeOfSymbol to make typescript actually go cross-files to find the real type

@codecov
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.21%. Comparing base (26a251e) to head (5fc0ed7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #84      +/-   ##
==========================================
+ Coverage   92.05%   92.21%   +0.15%     
==========================================
  Files          15       15              
  Lines         919      925       +6     
  Branches      274      272       -2     
==========================================
+ Hits          846      853       +7     
+ Misses         73       72       -1     

☔ 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.

@just-boris just-boris marked this pull request as ready for review July 29, 2025 15:22
@just-boris just-boris requested a review from a team as a code owner July 29, 2025 15:23
@just-boris just-boris requested review from johannes-weber and jperals and removed request for a team and jperals July 29, 2025 15:23
@just-boris just-boris added this pull request to the merge queue Jul 30, 2025
Merged via the queue into main with commit d65ba86 Jul 30, 2025
35 checks passed
@just-boris just-boris deleted the test-utils-new branch July 30, 2025 09:28
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