-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
TypeScript: tests from definitely typed #211
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds tests defined for the types in https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/slonik/slonik-tests.ts Exports some new methods to make them pass. Some modifications made for breaking changes that weren't ported over there. Uses expect-type for testing
@mmkal This looks amazing 😍 |
gajus
reviewed
Oct 20, 2020
🥳 |
mmkal
added a commit
to mmkal/slonik
that referenced
this pull request
Oct 21, 2020
* Add tests from definitely typed tests * Describe token types * Use generics for some internal types * Make createSqlTag generic * Give `...First` functions more intuitive typeargs
🎉 This PR is included in version 22.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #209
Part of #195
This adds tests defined for the types in https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/slonik/slonik-tests.ts - this is the API existing typescript users are working with - so after this, the only breaking changes for typescript users will be removal of some helpers like the interceptor presets that should already have gone from the definitions.
The tests are in
test/dts.ts
, GitHub may collapse it on some browsers since it's fairly long, but it's (almost) a straight copy-paste.Exports some new methods to make them pass. Some modifications made for breaking changes that weren't ported over there.
Uses expect-type for testing since definitely typed uses tslint/dtslint which is deprecated.
This also replaces most
any
instances insrc/types.ts
with generics.After this:
// @flow
annotations and switch// @ts-ignore
s to// @ts-expect-error
s (mostly just find and replace)At that point I think everything should be read to re-enable
semantic-release
in .travis.yml and mergetypescript
intomaster
! @gajus I should be able to do all that today.