gutenberg
gutenberg copied to clipboard
Convert data-controls test to TypeScript
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
tojest.Mock
Testing Instructions
npm run test:unit -- packages/data-controls
tests pass
npm run build:package-types
returns a zero exit code
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.
@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.