End-to-end tests that exercise built CipherStash binaries and cross-package behaviour. Lives outside packages/ because these tests are not tied to a single package — they verify how the published artefacts behave when a user actually runs them.
From the repo root:
pnpm run test:e2eThis delegates to turbo, which builds dependent packages first and then runs vitest run inside this workspace.
To run a single test file:
pnpm --filter @cipherstash/e2e exec vitest run tests/package-managers.e2e.test.ts| Test file | Scope |
|---|---|
tests/package-managers.e2e.test.ts |
The init providers and the wizard binary render bunx/pnpm dlx/yarn dlx/npx based on detected package manager. |
Some tests spawn the wizard binary, which runs an auth check before reaching the prerequisite path under test. These are wrapped in describe.skipIf(!authConfigured) and only run when:
~/.cipherstash/auth.jsonexists (typical local dev), orCS_CLIENT_IDandCS_CLIENT_KEYare set in the environment (CI with secrets wired)
The CI job for this workspace exposes those env vars from repo secrets. Without them the wizard suite is skipped (the provider suite still runs).
- File name must end in
.e2e.test.tsto be picked up byvitest.config.ts. - Prefer spawning the built binary (
packages/<pkg>/dist/bin/...) over importing source — that's the value e2e gives over unit tests. If the binary isn't built when your test runs, fail fast with a clear message; turbo'stest:e2etask declares^build+builddeps so a top-levelpnpm run test:e2ewill build first. - For tests that need a clean cwd, use
mkdtempSync(join(tmpdir(), 'stash-...-e2e-'))and clean up inafterEach. - Mock nothing. If you find yourself wanting to mock, the test belongs in a unit suite.