Skip to content

chore(tests): bump test deps, replaced mock-fetch - #108

Merged
petruki merged 1 commit into
masterfrom
staging
Oct 17, 2026
Merged

petruki merged 1 commit into
masterfrom
staging

Conversation

@petruki

@petruki petruki commented Oct 17, 2026

Copy link
Copy Markdown
Member

This pull request updates dependencies and refactors test utilities to improve test reliability and compatibility. The main changes include upgrading Deno and related tooling versions, switching to a new mock-fetch implementation, and refactoring test helper functions and test files to accommodate these changes.

Dependency and Tooling Upgrades:

  • Updated Deno version from 2.9.4 to 2.9.7 in .devcontainer/Dockerfile and all GitHub Actions workflow files, ensuring consistency across development and CI environments. [1] [2] [3] [4]
  • Upgraded SonarQube scan GitHub Action from v8.2.1 to v8.3.0 for improved code analysis. [1] [2]
  • Updated test dependencies to newer versions, including @std/testing, @std/async, @std/dotenv, and switched mock_fetch to jsr:@jeiea/mock-fetch@0.1.0.

Test Helper and Mock Refactoring:

  • Refactored given, givenError, and tearDown utility functions in tests/helper/utils.ts to use the new mock-fetch API, requiring explicit mock installation and restoration.
  • Updated the WaitSafe.wait method to use setInterval for more reliable timing in async test waits.

Test File Updates:

  • Refactored all test files using HTTP mocking to install and restore the mock fetch instance explicitly, passing the instance to helper functions. This ensures proper isolation and cleanup between tests. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]
  • Changed the integrated test to use the SWITCHER_URL environment variable instead of a hardcoded URL for improved configurability.

Summary of Most Important Changes:

Dependency and Tooling Upgrades

  • Upgraded Deno version to 2.9.7 and updated all references in Dockerfile and GitHub Actions workflows for consistency. [1] [2] [3] [4]
  • Updated SonarQube scan GitHub Action to v8.3.0 for improved CI code analysis. [1] [2]
  • Updated test dependencies and switched to jsr:@jeiea/mock-fetch@0.1.0 for HTTP mocking.

Test Helper and Test File Refactoring

  • Refactored test helper functions in tests/helper/utils.ts to support the new mock-fetch API, requiring explicit mock installation, instance passing, and restoration.
  • Updated all test files to use the new mocking approach, ensuring proper setup and teardown of HTTP mocks for reliable and isolated tests. [1] [2] [3] [4] [5] etc.)

Other Improvements

  • Improved the async wait utility in WaitSafe.wait to use setInterval for more accurate timing in tests.
  • Made the integrated test configurable via the SWITCHER_URL environment variable.

@petruki petruki added this to the v2.5.1 milestone Oct 17, 2026
@petruki petruki self-assigned this Oct 17, 2026
@sonarqubecloud

Copy link
Copy Markdown

@petruki
petruki merged commit d311909 into master Oct 17, 2026
7 checks passed
@petruki
petruki deleted the staging branch October 17, 2026 23:21
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