Docker Compose + Jest - Output of tests are not showing in the console

Viewed 458

I'm running a series of E2E tests against our Node API using Jest and supertest. We have a testing Dockerfile that builds & runs npm test, which we use inside this (simplified) docker-compose file:

version: '3'
services:
    db: .. postgres image ...
    app:
        build:
            context: .
            dockerfile: Dockerfile.e2e
        command: npm run test:e2e
        environment:
            REDIS_HOST: redis
            PORT: 4000
            DB_HOST: db
        links:
            - redis:localhost
            - db
        networks:
            - sdnet
        depends_on:
            - db
            - redis
    redis: ... redis image ...

When run in our CI environment (Bitbucket Pipelines), we get the full output of the tests: enter image description here

But when I try to run it locally in the terminal, I can see all the Docker logs, but cannot see the output from Jest telling me which tests have passed/failed. Any idea why? enter image description here

0 Answers
Related