gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Convert data-controls test to TypeScript

Open jpstevens opened this issue 9 months ago • 2 comments

What?

This PR converts the tests for the data-controls package to TypeScript.

Why?

Ensures package is fully type checked.

How?

  • converted files to .ts
  • cast dummy requests in tests to APIFetchOptions
  • explicitly cast mocked triggerFetch to jest.Mock

Testing Instructions

npm run test:unit -- packages/data-controls tests pass npm run build:package-types returns a zero exit code

jpstevens avatar May 10 '24 16:05 jpstevens

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jpstevens <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

github-actions[bot] avatar May 10 '24 16:05 github-actions[bot]

@jpstevens Thanks for your work on these PRs migrating to TypeScript.

I don't think there's value in migrating this small test file to TypeScript, especially when it's so full of assertions. I'll close this PR although I'm happy to discuss if folks have different opinions.

sirreal avatar Jun 13 '24 10:06 sirreal