To ensure reliability across different environments, wts uses a containerized E2E testing strategy.
Tests run inside a Docker container to provide:
- Clean State: Each run starts with a fresh file system.
- Isolation: No interaction with your local Git configuration or current worktrees.
- Reproducibility: Consistent environment (Bun, Git, OpenSSH) regardless of host OS.
A lightweight image based on oven/bun that includes:
- Bun: Runtime for the test script and CLI.
- Git: Core dependency for
wts. - OpenSSH Client: For cloning repositories (supports SSH agent forwarding).
Helper script that:
- Builds the Docker image (
wts-test). - Mounts the SSH agent socket (if available) to allow cloning private repos.
- Mounts the local
wtssource code into the container. - Executes the test suite.
A Bun script that acts as a user. It:
- Creates a temporary workspace (
/tmp/wts-e2e). - Executes real
wtscommands (clone,new,list,done). - Verifies the file system state (folders created,
.gitfiles valid) after each step.
Simply run:
bun test:e2eNote: For private repositories, ensure your local SSH agent is running (eval $(ssh-agent) usually handles this) so the container can authenticate via SSH forwarding.