fix: fix test infrastructure and add 5 component unit tests#17
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
fix: fix test infrastructure and add 5 component unit tests#17devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
- Fix test setup to use @analogjs/vitest-angular for proper zone.js and TestBed initialization (setup-zone + setupTestBed) - Use .js setup file to avoid Angular compiler interference - Add @analogjs/vitest-angular and zone.js as devDependencies - Downgrade @angular/core to 21.1.1 to match other Angular packages - Remove redundant zone.js imports and TestBed init from all 6 service specs - Set globals: true in vitest config for zone.js patching compatibility - Add article-meta.component.spec.ts (7 tests) - Add home.component.spec.ts (11 tests) - Add profile.component.spec.ts (9 tests) - Add profile-articles.component.spec.ts (6 tests) - Add profile-favorites.component.spec.ts (6 tests) All 219 tests pass across 11 test files. Co-Authored-By: Wes Convery <2wconvery@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Devin Review
|
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.
Summary
Fixes the broken test infrastructure and adds 5 new component unit test specs. All 219 tests now pass across 11 test files.
Infrastructure fixes
test-setup.tswith@analogjs/vitest-angularfor proper zone.js + TestBed initialization.jssetup file to avoid Angular compiler plugin interference with setup code@analogjs/vitest-angularandzone.jsas devDependencies@angular/corefrom 21.2.4 → 21.1.1 to fix version mismatch with other@angular/*packages (was causingNG0401: No platform exists!)zone.jsimports andTestBed.initTestEnvironment()calls from all 6 existing service spec filesglobals: truein vitest config for zone.js patching compatibilityNew component specs
article-meta.component.spec.tshome.component.spec.tsprofile.component.spec.tsprofile-articles.component.spec.tsprofile-favorites.component.spec.tsReview & Testing Checklist for Human
bun run test -- --runlocally and verify all 219 tests pass@angular/coredowngrade to 21.1.1 doesn't break anything in the app (bun run start)toBeTruthy())Notes
test-setup.tswas being processed by the@analogjs/vite-plugin-angularcompiler, which silently broke the zone.js and TestBed initialization. Switching to a.jssetup file that delegates to@analogjs/vitest-angularresolved it.@angular/core@21.2.4was bumped by Dependabot (PR chore(deps): bump @angular/core from 21.1.1 to 21.2.4 realworld-apps/angular-realworld-example-app#347) without upgrading the other Angular packages, causingNG0401errors during platform creation.Link to Devin session: https://app.devin.ai/sessions/d04ae85f7d4d4dc5b68f8f4c3a50dcb8
Requested by: @WesternConcrete