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

refactor: Reorganize type definition test files #2488

Open
wants to merge 7 commits into
base: alpha
Choose a base branch
from

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Mar 9, 2025

Pull Request

Issue

All definition tests are contained in single file. This is hard to maintain and isn't scalable.

Ref: #2012

Approach

  • Allow for multiple tests files
  • Use same test format as unit and integration tests
  • Create a POC

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

Copy link

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Closes: #123 in the PR description, so I can recognize it.

Copy link

codecov bot commented Mar 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (478147c) to head (5569133).

Additional details and impacted files
@@            Coverage Diff            @@
##             alpha     #2488   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         6268      6268           
  Branches      1468      1452   -16     
=========================================
  Hits          6268      6268           

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

@dplewis dplewis requested a review from a team March 9, 2025 01:01
@dplewis
Copy link
Member Author

dplewis commented Mar 9, 2025

@mtrezza I added one example for Parse.Session since it's a small implementation. The community can addon more files in the future. An added benefit is we can ensure that all definitions are accounted for once the tests are migrated. In this case Parse.Session has all types tested. You can check by comparing it to the definition file ParseSession.d.ts

@dplewis dplewis requested a review from mtrezza March 12, 2025 23:25
@@ -53,6 +53,7 @@
"@semantic-release/npm": "12.0.1",
"@semantic-release/release-notes-generator": "14.0.3",
"@types/facebook-js-sdk": "3.3.11",
"@types/jest": "29.5.14",
Copy link
Member

Choose a reason for hiding this comment

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

What is this needed for?

Copy link
Member Author

@dplewis dplewis Mar 13, 2025

Choose a reason for hiding this comment

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

That’s how I’m able to use it and describe in the definition test files. It’s also useful if we ever convert the unit tests to Typescript

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