Skip to content

DominikZajac/cblite-js-tests

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cblite-js-tests

Test suite for the cblite-js library, including Docker setup for Couchbase Server and Sync Gateway.

Overview

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 Environment Setup

Prerequisites

  • Docker and Docker Compose
  • Git

Starting the Docker Environment

  1. Start the Docker containers for Couchbase Server and Sync Gateway:
docker-compose up -d

This will start:

Container Details

Containers configuration based on Tutorial - Set up Sync Gateway for use with Inventory Demo App, check for more configuration details.

Couchbase Server Container

  • Ports: 8091-8096, 11210
  • Pre-configured bucket: "projects" with sample data
  • Automatically creates required indexes

Sync Gateway Container

  • Ports: 4984-4986
  • Pre-configured for sync with the "projects" bucket
  • User accounts set up with team-based access control

Stopping the Environment

docker-compose down

Resetting the Environment

To completely reset the environment (removes all data):

docker-compose down -v
docker-compose up -d

Sample Data

The 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.

Sync Gateway Configuration

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

About

Tests for the cblite-js library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.0%
  • Shell 1.9%
  • Dockerfile 0.1%