Skip to content

Add unit tests for retrieveArticleData - #94

Merged
AlexJSully merged 2 commits into
masterfrom
87-testing-improve-test-coverage-for-fetch-operations
Oct 19, 2026
Merged

AlexJSully merged 2 commits into
masterfrom
87-testing-improve-test-coverage-for-fetch-operations

Conversation

@AlexJSully

Copy link
Copy Markdown
Owner

No description provided.

@AlexJSully AlexJSully self-assigned this Oct 19, 2026
Copilot AI balanced review requested due to automatic review settings October 19, 2026 01:17
@AlexJSully AlexJSully linked an issue Oct 19, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The browser-loaded minified script remains unchanged, leaving the new HTTP error handling unavailable to users.

1 open issue
What changed in this PR

Adds coverage for article metadata retrieval and improves HTTP failure handling.

Changes:

  • Tests successful retrieval, network errors, HTTP errors, and invalid JSON.
  • Returns the retrieval promise and rejects non-OK responses.
  • Improves test cleanup and disables automatic page initialization.
File Description
src/​scripts/​index.test.js Adds retrieval tests and test isolation.
src/​scripts/​index.js Returns the fetch promise and checks HTTP status.

Review effort: Balanced

Comment thread src/scripts/index.js
@AlexJSully
AlexJSully merged commit c854fd9 into master Oct 19, 2026
6 checks passed
@AlexJSully
AlexJSully deleted the 87-testing-improve-test-coverage-for-fetch-operations branch October 19, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Testing: Improve Test Coverage for Fetch Operations

2 participants