Add comprehensive unit test suite for Angular2-HN #129
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.
Add comprehensive unit test suite for Angular2-HN
Summary
This PR adds unit tests for all components, services, and pipes in the Angular2-HN application. The project previously had no
.spec.tstest files, only placeholder e2e tests. This adds 14 new test files covering the entire application.Components tested: AppComponent, FeedComponent, ItemComponent, ItemDetailsComponent, CommentComponent, UserComponent, HeaderComponent, FooterComponent, SettingsComponent, LoaderComponent, ErrorMessageComponent
Services tested: HackerNewsAPIService, SettingsService
Pipes tested: CommentPipe
The karma.conf.js was also updated to support headless Chrome for CI environments.
Review & Testing Checklist for Human
ChrometoChromeHeadlessandsingleRunfromfalsetotrue. Confirm this is the desired behavior for the project.Recommended test plan:
--no-sandboxand--disable-gpuflags in the ChromeHeadlessCI launchernpm testlocally to verify tests work in a standard development environmentNotes
Link to Devin run: https://app.devin.ai/sessions/d993f1572b614bbaa7e42d5436188931
Requested by: mason.batchelor@cognition.ai (@mbatchelor81)