test: add regression coverage for @ApiClient code generation - #172
Open
FranciscoValerio wants to merge 2 commits into
Open
test: add regression coverage for @ApiClient code generation#172FranciscoValerio wants to merge 2 commits into
FranciscoValerio wants to merge 2 commits into
Conversation
Adds a build_test-based regression test asserting that classes annotated with @APIClient() are registered as lazy singletons via their generated implementation (_X.new) instead of the abstract constructor being torn off. Covers the scenario from Flutterando#139, fixed in Flutterando#144, which currently has no automated test guarding against regression. Also adds build_test as a dev_dependency of vaden_class_scanner.
Extracts a shared builder-runner helper and adds a second case asserting FlutterVadenBuilder still succeeds and emits no @APIClient boilerplate when the package only has @dto classes, guarding the apiClientBuffer threading added in Flutterando#144.
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.
📄 Description
Adds an automated regression test for
@ApiClient()code generationin
vaden_class_scanner. The 0.1.4 -> 1.0.x refactor briefly droppedsupport for
@ApiClient()(issue #139), fixed in #144, but no testwas added to prevent this from regressing again.
🔄 Changes Made
test/fixtures/api_client_fixture.dartwith an@ApiClient()-annotated abstract class.test/api_client_generation_test.dartusingbuild_test'stestBuilderto assert the generatedvaden_application.dartregisters the class via its generatedimplementation, not the abstract constructor.
succeeds and emits no
@ApiClientboilerplate when the packagehas no
@ApiClientclasses, guarding the optionalapiClientBufferthreading introduced in fix: @Scope and @ApiClient handling #144.build_testas a dev_dependency ofvaden_class_scanner.✅ Checklist
🔗 Related Issue
Relates to #139 (fixed by #144) — adds missing test coverage.