Skip to main content

⚙️ Setup Guide

This guide will help you set up and run the Rick and Morty API test suite.

📋 Prerequisites

Before you begin, ensure you have the following installed:

RequirementVersionDescription
Node.js18+JavaScript runtime
npmLatestPackage manager
DockerLatestContainerization (optional)

🖥️ Local Installation

1. Install Dependencies

# Clone the repository
git clone https://github.com/anxoportela/postman-newman-gh.git

# Navigate to directory
cd postman-newman-gh

# Install dependencies
npm install

2. Run Tests

# Run Newman tests
npm test

# Or use make
make test

🐳 Docker Installation

Option 1: Docker Compose

# Build the image
make docker-build

# Run tests in Docker
make docker-test

# Serve docs locally
make docker-docs

Option 2: Manual Docker

# Build image
docker build -t rick-morty-newman .

# Run tests
docker run rick-morty-newman npm test

📦 Available Commands

CommandDescription
npm installInstall dependencies
npm testRun Newman tests
npm run docs:buildBuild documentation
npm run docs:serveServe docs locally
make docker-buildBuild Docker image
make docker-testRun tests in Docker
make docker-docsServe docs in Docker

⚠️ Troubleshooting

Common Issues

npm install fails

# Try with legacy peer deps
npm install --legacy-peer-deps

Tests fail

  • Check your internet connection
  • Verify the Rick and Morty API is accessible
  • Ensure no firewall is blocking requests

🚀 Next Steps