[PR #221] [MERGED] test: avoid error string matching #365

Closed
opened 2026-02-26 21:34:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/221
Author: @rudrankriyam
Created: 1/27/2026
Status: Merged
Merged: 1/27/2026
Merged by: @rudrankriyam

Base: mainHead: fix/go-standards-errors


📝 Commits (1)

  • d410593 test: avoid brittle error string checks

📊 Changes

18 files changed (+123 additions, -123 deletions)

View changed files

📝 cmd/commands_test.go (+12 -14)
📝 cmd/finance_test.go (+2 -2)
📝 cmd/ipa_test.go (+0 -4)
📝 cmd/localizations_test.go (+0 -3)
📝 cmd/pricing_test.go (+0 -4)
📝 cmd/shared_test.go (+0 -4)
📝 cmd/signing_fetch_test.go (+4 -4)
📝 cmd/users_test.go (+0 -4)
📝 cmd/versions_test.go (+2 -3)
📝 internal/asc/analytics_test.go (+3 -11)
📝 internal/asc/client_http.go (+7 -13)
📝 internal/asc/client_http_test.go (+12 -25)
📝 internal/asc/client_test.go (+7 -2)
internal/asc/errors.go (+51 -0)
📝 internal/asc/finance_test.go (+3 -3)
📝 internal/asc/phased_release_test.go (+0 -3)
📝 internal/asc/review_responses_test.go (+20 -20)
📝 internal/auth/keychain_test.go (+0 -4)

📄 Description

Summary

  • introduce typed API errors with sentinel helpers for error checks
  • update tests to assert on error types or ErrHelp instead of string matching
  • align not-found tests with API error codes

Test plan

  • make build
  • make lint
  • make test

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/221 **Author:** [@rudrankriyam](https://github.com/rudrankriyam) **Created:** 1/27/2026 **Status:** ✅ Merged **Merged:** 1/27/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `main` ← **Head:** `fix/go-standards-errors` --- ### 📝 Commits (1) - [`d410593`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/d410593dce93fa2e5af994a29e803f83754af217) test: avoid brittle error string checks ### 📊 Changes **18 files changed** (+123 additions, -123 deletions) <details> <summary>View changed files</summary> 📝 `cmd/commands_test.go` (+12 -14) 📝 `cmd/finance_test.go` (+2 -2) 📝 `cmd/ipa_test.go` (+0 -4) 📝 `cmd/localizations_test.go` (+0 -3) 📝 `cmd/pricing_test.go` (+0 -4) 📝 `cmd/shared_test.go` (+0 -4) 📝 `cmd/signing_fetch_test.go` (+4 -4) 📝 `cmd/users_test.go` (+0 -4) 📝 `cmd/versions_test.go` (+2 -3) 📝 `internal/asc/analytics_test.go` (+3 -11) 📝 `internal/asc/client_http.go` (+7 -13) 📝 `internal/asc/client_http_test.go` (+12 -25) 📝 `internal/asc/client_test.go` (+7 -2) ➕ `internal/asc/errors.go` (+51 -0) 📝 `internal/asc/finance_test.go` (+3 -3) 📝 `internal/asc/phased_release_test.go` (+0 -3) 📝 `internal/asc/review_responses_test.go` (+20 -20) 📝 `internal/auth/keychain_test.go` (+0 -4) </details> ### 📄 Description ## Summary - introduce typed API errors with sentinel helpers for error checks - update tests to assert on error types or ErrHelp instead of string matching - align not-found tests with API error codes ## Test plan - [x] `make build` - [x] `make lint` - [x] `make test` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 21:34:49 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#365
No description provided.