Skip to content

chore(tests): updated test files per functionality#102

Merged
petruki merged 2 commits intomasterfrom
staging
Mar 22, 2026
Merged

chore(tests): updated test files per functionality#102
petruki merged 2 commits intomasterfrom
staging

Conversation

@petruki
Copy link
Copy Markdown
Member

@petruki petruki commented Mar 22, 2026

This pull request introduces several updates focused on dependency upgrades, test coverage improvements, and minor code enhancements. The main highlights are the upgrade of the Deno runtime and related dependencies, the addition of new and more comprehensive tests (including integration and context validation), and the introduction of a utility to clean up HTTP client resources. There are also some minor renamings and improvements to test script permissions.

Dependency and Environment Upgrades:

  • Upgraded the Deno runtime version from 2.6.4 to 2.7.7 in the .devcontainer/Dockerfile and all relevant GitHub Actions workflows, ensuring consistency across local development and CI environments. ([[1]](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-13bd9d7a30bf46656bc81f1ad5b908a627f9247be3f7d76df862b0578b534fc6L1-R1), [[2]](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-38ee08b0d1916cb5b9d8a093e986366eaafd908bc1f516f4fced0033c155d842L20-R23), [[3]](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-38ee08b0d1916cb5b9d8a093e986366eaafd908bc1f516f4fced0033c155d842L48-R48), [[4]](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-9a1c250ec072fc76ad44435cd9462d5693ea81f304d650922d3c2792bef267c2L36-R39))
  • Updated several @std library dependencies to newer versions in both src/deps.ts and tests/deps.ts, improving compatibility and stability. ([[1]](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-148f36f0a365bdf27732ea65daa5ff8c8a9bb768820a50dd689675ba7df9980eL1-R1), [[2]](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-57d30fbbf1d1cdb1a5eca860805d6d2f5d96ce1765fbab935fc36b630c707786L16-R26))

Test Coverage and Quality Improvements:

  • Added a new comprehensive test suite for the Switcher context (tests/switcher-context.test.ts), covering invalid and valid certificate paths and missing required fields. ([tests/switcher-context.test.tsR1-R123](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-b543b18e959266e5fbce646da809fb0e9a11c0c4455ca1c133953540a1ed3b9cR1-R123))
  • Introduced integration tests that interact with the remote API, verifying end-to-end functionality and snapshot loading. ([tests/switcher-integrated.test.tsR1-R64](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-ffd4e716943f8bd89d33271ee40a391d79b258e89e20450fe048668517ca5ed8R1-R64))
  • Added a dummy certificate file for use in certificate-related tests. ([tests/helper/dummy-cert.pemR1-R29](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-320c4c45df18c8ed0192cd820b5be698a434c1430a8c14440ee92e509106400eR1-R29))
  • Renamed and clarified test suite descriptions in the local client tests for better readability. ([[1]](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-ada168040d1da72a2fc53dc640b87b7259a8dc556600a1422d1ba43111d69d6dL22-R22), [[2]](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-ada168040d1da72a2fc53dc640b87b7259a8dc556600a1422d1ba43111d69d6dL249-R249))
  • Removed a redundant or obsolete test suite related to the "assume" feature in the local client tests. ([tests/switcher-local.test.tsL394-L500](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-ada168040d1da72a2fc53dc640b87b7259a8dc556600a1422d1ba43111d69d6dL394-L500))

Codebase Enhancements:

  • Added a destroyHttpClient utility in src/lib/remote.ts to allow explicit cleanup of HTTP client resources, supporting better test isolation and resource management. ([src/lib/remote.tsR23-R28](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-d8aab20401e8f63d739d8a171ef2c1f3a53009b2dab90a31be572f1adb6801c3R23-R28))
  • Updated test scripts in deno.jsonc to include the --allow-env permission, allowing access to environment variables during tests. ([deno.jsoncL9-R10](https://github.com/switcherapi/switcher-client-deno/pull/102/files#diff-81342196266f9373572c759839aa5a9ab9942af52ce56316b4855b3df8db588aL9-R10))

These changes collectively improve the reliability, maintainability, and test coverage of the project while keeping dependencies up to date.

@petruki petruki self-assigned this Mar 22, 2026
@petruki petruki added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 22, 2026
@sonarqubecloud
Copy link
Copy Markdown

@petruki petruki merged commit 081db44 into master Mar 22, 2026
7 checks passed
@petruki petruki deleted the staging branch March 22, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant