diff --git a/tests/real-integration/blog-scenario/docker/Dockerfile.blog-api b/tests/real-integration/blog-scenario/docker/Dockerfile.blog-api index b7f93d0..58a3369 100644 --- a/tests/real-integration/blog-scenario/docker/Dockerfile.blog-api +++ b/tests/real-integration/blog-scenario/docker/Dockerfile.blog-api @@ -1,13 +1,17 @@ # Blog API Node FROM node:18-alpine -# Install system dependencies +# Install system dependencies including build tools for native modules RUN apk add --no-cache \ curl \ python3 \ make \ g++ \ - git + git \ + cmake \ + pkgconfig \ + libc6-compat \ + linux-headers # Create app directory WORKDIR /app @@ -19,7 +23,7 @@ COPY package*.json pnpm-lock.yaml ./ RUN npm install -g pnpm # Install full dependencies and reflect-metadata -RUN pnpm install --frozen-lockfile --ignore-scripts \ +RUN pnpm install --frozen-lockfile \ && pnpm add reflect-metadata @babel/runtime # Install tsx globally for running TypeScript files (better ESM support) diff --git a/tests/real-integration/blog-scenario/docker/blog-api-server.ts b/tests/real-integration/blog-scenario/docker/blog-api-server.ts index 37e653a..e5213c3 100644 --- a/tests/real-integration/blog-scenario/docker/blog-api-server.ts +++ b/tests/real-integration/blog-scenario/docker/blog-api-server.ts @@ -1,5 +1,17 @@ #!/usr/bin/env node +// Polyfill CustomEvent for Node.js environment +if (typeof globalThis.CustomEvent === 'undefined') { + globalThis.CustomEvent = class CustomEvent extends Event { + detail: T; + + constructor(type: string, eventInitDict?: CustomEventInit) { + super(type, eventInitDict); + this.detail = eventInitDict?.detail; + } + } as any; +} + import express from 'express'; import { DebrosFramework } from '../../../../src/framework/DebrosFramework'; import { User, UserProfile, Category, Post, Comment } from '../models/BlogModels'; diff --git a/tests/real-integration/blog-scenario/docker/docker-compose.blog.yml b/tests/real-integration/blog-scenario/docker/docker-compose.blog.yml index cb6a5a6..d27017c 100644 --- a/tests/real-integration/blog-scenario/docker/docker-compose.blog.yml +++ b/tests/real-integration/blog-scenario/docker/docker-compose.blog.yml @@ -33,13 +33,13 @@ services: environment: - NODE_ID=blog-node-1 - NODE_PORT=3000 - - IPFS_PORT=4001 + - IPFS_PORT=4011 - BOOTSTRAP_PEER=blog-bootstrap - SWARM_KEY_FILE=/data/swarm.key - NODE_ENV=test ports: - "3001:3000" - - "4011:4001" + - "4011:4011" volumes: - ./swarm.key:/data/swarm.key:ro - blog-node-1-data:/data @@ -63,13 +63,13 @@ services: environment: - NODE_ID=blog-node-2 - NODE_PORT=3000 - - IPFS_PORT=4001 + - IPFS_PORT=4012 - BOOTSTRAP_PEER=blog-bootstrap - SWARM_KEY_FILE=/data/swarm.key - NODE_ENV=test ports: - "3002:3000" - - "4012:4001" + - "4012:4012" volumes: - ./swarm.key:/data/swarm.key:ro - blog-node-2-data:/data @@ -93,13 +93,13 @@ services: environment: - NODE_ID=blog-node-3 - NODE_PORT=3000 - - IPFS_PORT=4001 + - IPFS_PORT=4013 - BOOTSTRAP_PEER=blog-bootstrap - SWARM_KEY_FILE=/data/swarm.key - NODE_ENV=test ports: - "3003:3000" - - "4013:4001" + - "4013:4013" volumes: - ./swarm.key:/data/swarm.key:ro - blog-node-3-data:/data