Skip to content

test: local Mercury integration tests (MERCURY_TOKEN via .env)#6

Open
ex3ndr-bot wants to merge 5 commits intoex3ndr:mainfrom
ex3ndr-bot:feature/integration-tests
Open

test: local Mercury integration tests (MERCURY_TOKEN via .env)#6
ex3ndr-bot wants to merge 5 commits intoex3ndr:mainfrom
ex3ndr-bot:feature/integration-tests

Conversation

@ex3ndr-bot
Copy link
Collaborator

What

Adds Vitest-based unit tests + local-only integration tests that validate read-only Mercury API calls using .

Token handling

  • is ignored
  • is committed
  • Integration tests skip if is not set
  • Errors are redacted to avoid leaking the token / Authorization header

Run locally

See README section:

  • set

mercury-cli@0.1.0 test:integration
TMPDIR=./.tmp vitest run --config vitest.integration.config.ts

�[1m�[46m RUN �[49m�[22m �[36mv4.0.18 �[39m�[90m/home/steve/.daycare/workspace/maintainer/mercury-cli-integration-tests2�[39m

�[31m❯�[39m tests/integration/mercury-readonly.test.ts �[2m(�[22m�[2m0 test�[22m�[2m)�[22m

�[2m Test Files �[22m �[1m�[31m1 failed�[39m�[22m�[90m (1)�[39m
�[2m Tests �[22m �[2mno tests�[22m
�[2m Start at �[22m 19:08:09
�[2m Duration �[22m 143ms�[2m (transform 0ms, setup 0ms, import 0ms, tests 0ms, environment 0ms)�[22m

CI

Integration tests are not wired into any GitHub Actions workflow.

- Add vitest + dotenv and npm scripts:
  - test (unit)
  - test:integration (local-only)
- Add .env.example and ignore .env
- Integration suite skips when MERCURY_TOKEN is missing
- Add token redaction helper to avoid leaking secrets
- Document local integration test setup in README
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