Test suite for the cblite-js library, including Docker setup for Couchbase Server and Sync Gateway.
This repository contains test files for validating the cblite-js TypeScript interface definitions against real-world use cases. It includes a Docker-based testing environment with Couchbase Server and Sync Gateway for replicator tests.
The tests are designed to be injected into and executed in the example app (react-native example app, ionic example app) rather than through a traditional test runner.
- Docker and Docker Compose
- Git
- Start the Docker containers for Couchbase Server and Sync Gateway:
docker-compose up -dThis will start:
- Couchbase Server: Available at http://localhost:8091
- Username: Administrator
- Password: P@$$w0rd12
- Sync Gateway: Available at http://localhost:4984/projects
Containers configuration based on Tutorial - Set up Sync Gateway for use with Inventory Demo App, check for more configuration details.
- Ports: 8091-8096, 11210
- Pre-configured bucket: "projects" with sample data
- Automatically creates required indexes
- Ports: 4984-4986
- Pre-configured for sync with the "projects" bucket
- User accounts set up with team-based access control
docker-compose downTo completely reset the environment (removes all data):
docker-compose down -v
docker-compose up -dThe Docker environment automatically imports sample project data into the Couchbase Server, including:
- Projects for different warehouses (Santa Clara, Houston, Jacksonville)
- Team-based access control
- Document structure with properties like name, description, createdBy, etc.
The Sync Gateway is configured with:
- Channel-based sync based on team membership
- Document validation
- Import filtering for specific document types
- Access control based on team roles