Skip to content

fix: make fetch example tests actually run#153

Merged
nilslice merged 1 commit intomainfrom
nilslice/fix-fetch-async-tests
Feb 9, 2026
Merged

fix: make fetch example tests actually run#153
nilslice merged 1 commit intomainfrom
nilslice/fix-fetch-async-tests

Conversation

@nilslice
Copy link
Member

@nilslice nilslice commented Feb 9, 2026

Summary

The fetch example's async tests were not running properly. The asyncFetchTest() function was being called without await, returning a Promise that couldn't be destructured. Additionally, Response body tests using .then() callbacks never executed during synchronous evaluation, so they weren't validating anything.

Changes

  • Made greet() async to properly await all Promise-based operations
  • Replaced .then() callback tests with await for cleaner, blocking validation
  • Added microtask queue drains to allow .then() chain to execute before checks
  • asyncFetchTest() now properly returns test results that get validated

🤖 Generated with Claude Code

…perations

The asyncFetchTest was being called without await, returning a Promise that couldn't be destructured. Additionally, the Response.text() and Response.json() tests were using .then() callbacks that never executed during synchronous function evaluation. Made greet() async and use await throughout to ensure all Promise-based operations properly resolve before validation.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@nilslice nilslice merged commit 88eade1 into main Feb 9, 2026
6 checks passed
@nilslice nilslice deleted the nilslice/fix-fetch-async-tests branch February 9, 2026 20:07
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.

1 participant