Lỗi Thường Gặp
AuthError: Invalid or expired access token. (HTTP 401)
API key trong .env đã hết hạn.
# Cập nhật .envIMBRACE_API_KEY=api_xxx_moiApiError: [400] {"message":"must have required property 'type'"}
Gọi channel.list() thiếu param bắt buộc.
# Saiclient.channel.list()
# Đúngclient.channel.list(type="web")ApiError: [404] với URL có path kép
URL bị double vì IMBRACE_BASE_URL được set nhầm thành full endpoint.
# SaiIMBRACE_BASE_URL=https://app-gatewayv2.imbrace.co/private/backend/v1/third_party_token
# ĐúngIMBRACE_BASE_URL=https://app-gatewayv2.imbrace.coIntegration test bị skip toàn bộ
IMBRACE_API_KEY chưa được set.
# Set tạm thời khi chạyIMBRACE_API_KEY=api_xxx pytest tests/integration -v -m integration
# Hoặc thêm vào .envecho "IMBRACE_API_KEY=api_xxx" >> py/.envCannot find module (TypeScript tests)
Đường dẫn import trong test file cần đúng cấp thư mục:
| Vị trí test file | Import |
|---|---|
tests/unit/*.test.ts | ../../src/client.js |
tests/unit/resources/*.test.ts | ../../../src/app/resources/x.js |
tests/integration/*.test.ts | ../../src/client.js |
mypy báo lỗi Pattern matching is only supported in Python 3.10
mypy scan nhầm vào site-packages. Đã config trong pyproject.toml. Nếu vẫn lỗi:
mypy src/imbrace --exclude site-packages