claude-code-sandbox/test
Onur Solmaz 55a36fcf1f
Add Podman support (#12)
* Add Podman support

* Add tests
2025-06-12 16:59:16 +02:00
..
e2e Exclude .DS_Store files, run prettier 2025-06-04 21:16:09 +02:00
integration Add Podman support (#12) 2025-06-12 16:59:16 +02:00
docker-config.test.js Add Podman support (#12) 2025-06-12 16:59:16 +02:00
dummy.test.js Add workflows 2025-06-05 17:28:12 +02:00
README.md Exclude .DS_Store files, run prettier 2025-06-04 21:16:09 +02:00

Test Directory Structure

This directory contains all tests for the Claude Code Sandbox project.

Directory Layout

test/
├── unit/              # Unit tests for individual modules
├── integration/       # Integration tests for module interactions
├── e2e/              # End-to-end tests for full workflow scenarios
├── fixtures/         # Test data, mock responses, sample files
└── helpers/          # Shared test utilities and helpers

Running Tests

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run only unit tests
npm run test:unit

# Run only integration tests
npm run test:integration

# Run only E2E tests
npm run test:e2e

# Run tests with coverage
npm run test:coverage

Test Naming Conventions

  • Unit tests: *.test.ts or *.spec.ts
  • Test files should mirror the source structure
    • Example: test/unit/container.test.ts tests src/container.ts

Writing Tests

Tests are written using Jest with TypeScript support. The Jest configuration is in jest.config.js at the project root.

Example Unit Test

import { someFunction } from "../../src/someModule";

describe("someFunction", () => {
  it("should do something", () => {
    const result = someFunction("input");
    expect(result).toBe("expected output");
  });
});

E2E Tests

End-to-end tests are located in test/e2e/ and test the complete workflow of the CLI tool. These tests:

  • Create actual Docker containers
  • Run Claude commands
  • Verify git operations
  • Test the full user experience

Run E2E tests with: npm run test:e2e