I have a simple Dockerfile:
FROM node:8
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm install
# If you are building your code for production
# RUN npm install --only=production
# Bundle app source
COPY . .
CMD ["npm", "run", "test"]
I run it inside Google Cloud Build and get the following logs:
...
Removing intermediate container 19ae183b28c6
---> 5802f218fa4e
Step 5/6 : COPY . .
---> a1600834b6e0
Step 6/6 : CMD npm run test
---> Running in bfb7be511b96
Removing intermediate container bfb7be511b96
---> 6e974d117670
Successfully built 6e974d117670
...
At step 6/6
, npm run test
, I am not seeing the logs that I would on my local machine:
npm run test
:
PASS __tests__/order.spec.ts
PASS __tests__/news.spec.ts
PASS __tests__/product.spec.ts (5.328s)
PASS __tests__/review.spec.ts
PASS __tests__/donation.spec.ts
PASS __tests__/referral.spec.ts
PASS __tests__/nonprofit.spec.ts
Test Suites: 7 passed, 7 total
Tests: 22 passed, 22 total
Snapshots: 0 total
Time: 8.291s, estimated 9s
How can I get these logs to show up in the build logs?