Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

fix: FormData::entries(), FormData::[Symbol.iterator]() #175

Merged
merged 4 commits into from
Jan 18, 2022

Conversation

threepointone
Copy link
Contributor

The types for FormData::entries(), FormData::[Symbol.iterator]() are marked as arrays of IterableIterators, which doesn't seem right. This PR removes the array notation, and adds tests for the both of them.

@threepointone
Copy link
Contributor Author

Oh hmm, we don't run tsc in CI, do we. Maybe we should.

Copy link
Contributor

@mrbbot mrbbot left a comment

Choose a reason for hiding this comment

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

Looks good! ✅

You're right, seems like we only check the overrides are valid TypeScript in CI, not that they type check with the tests. 🙁

npm test is all set up for that though, so should just be a case of adding that to the workflow.

@JacobMGEvans
Copy link
Contributor

Oh hmm, we don't run tsc in CI, do we. Maybe we should.

It will soon 😄
https://github.com/cloudflare/workers-types/pull/170/files#diff-4ea51473b34d404d0631fc198780ff5e66c201c0b1af60bdb4bff10ded6e10c8R42-R43

@threepointone
Copy link
Contributor Author

One of the problems with this PR, is the test will fail until the overrides are applied to the root index.d.ts file. Hrmm.

threepointone and others added 2 commits January 18, 2022 18:36
The types for `FormData::entries()`, `FormData::[Symbol.iterator]()` are marked as arrays of IterableIterators, which doesn't seem right. This PR removes the array notation, and adds tests for the both of them.
@changeset-bot
Copy link

changeset-bot bot commented Jan 18, 2022

🦋 Changeset detected

Latest commit: 26b78d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/workers-types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@threepointone
Copy link
Contributor Author

Commented out the failing tests, will uncomment after the next round of overrides are applied. We should revisit this and figure something better later.

@threepointone threepointone merged commit 17d21e9 into master Jan 18, 2022
@threepointone threepointone deleted the fix-formdata-entries-iterator branch January 18, 2022 18:42
@github-actions github-actions bot mentioned this pull request Jan 18, 2022
threepointone added a commit that referenced this pull request Jan 19, 2022
We'd added the tests in #175, but they were commented out because the overrides weren't applied. This PR applies the overrides to `index.d.ts`, so we can enable those tests now.
@threepointone
Copy link
Contributor Author

Enabled the tests in #186. (We should still revisit)

threepointone added a commit that referenced this pull request Jan 19, 2022
* Updated types for 2022-01-19

* Enable tests for `FormData::entries()`, `FormData::[Symbol.iterator]()`

We'd added the tests in #175, but they were commented out because the overrides weren't applied. This PR applies the overrides to `index.d.ts`, so we can enable those tests now.

Co-authored-by: autodecl-bot[bot] <91285878+autodecl-bot[bot]@users.noreply.github.com>
Co-authored-by: Sunil Pai <spai@cloudflare.com>
@vlovich
Copy link
Contributor

vlovich commented Jan 21, 2022

FWIW npm test is run on every internal Runtime CI build. The automation won't publish a PR that's not passing and internally we won't even be able to make a release until the tests are fixed.

@JacobMGEvans
Copy link
Contributor

FWIW npm test is run on every internal Runtime CI build. The automation won't publish a PR that's not passing and internally we won't even be able to make a release until the tests are fixed.

Mind if I catch up with you tomorrow on this @vlovich?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants