Introducing flinch for compile-time tests#175
Merged
jeremyruppel merged 4 commits intomainfrom Jul 18, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces flinch, a comprehensive TypeScript compile-time testing library, and integrates type testing throughout the flickr-sdk codebase. The PR also improves type safety by converting JSDoc comments to TypeScript types and making MockTransport more flexible.
- Introduces a new package
@flickr/flinchfor compile-time TypeScript type testing - Adds comprehensive type tests for flickr-sdk interfaces and types using the new testing library
- Converts JSDoc type annotations to proper TypeScript types across test files
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/flinch/ | Complete implementation of the flinch type testing library with utilities, tests, and documentation |
| test/types.ts | New comprehensive type tests for flickr-sdk interfaces using flinch |
| tsconfig.test.json | TypeScript configuration for running type tests |
| src/transport/mock.ts | Updates MockTransport to accept any type instead of just strings |
| src/index.ts | Exports additional types and configurations for better type testing |
| test/*.ts | Converts JSDoc type annotations to proper TypeScript types |
| package.json | Adds workspace configuration and updates test script |
Comments suppressed due to low confidence (1)
test/transport.fetch.ts:114
- Using
anytype reduces type safety. Consider using a more specific type likePromise<[IncomingMessage, ServerResponse]>sinceonce(server, 'request')returns a promise that resolves with request and response objects.
const promise: Promise<any> = once(server, "request")
This file contains hidden or 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
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.
Unsatisfied with other solutions out there, I worked with AI to come up with a super comprehensive testing library for typescript. Check the README for usage details.
This also introduces type tests for many of the interfaces exported from
flickr-sdk.This also also makes it so
MockTransportcan acceptanytype of thing to return, not juststring.