How to run angular test using Cloud Build?

I use out-of-the-box Angular testing framework: Jasmine and karma for Unit Test and GCP Cloud Build to deploy the app. However, there is a problem in testing because there is no Chrome installed for the node Docker image.

What is the best way to handle that? Create a customized docker image? Or is there any well-known docker image I can leverage for build and test Angular app in Cloud Build?

cloudbuild.yaml

steps:
  # Install
  - name: node:14
    entrypoint: npm
    args: ["install"]
  #Build
  - name: node:14
    entrypoint: npm
    args: ["run", "build", "--", "--aot"]

  # Test <- This step fails. See the error message below
  - name: node:14
    entrypoint: npm
    args: ["run", "test", "--", "--watch=false"]

  # Deploy to Firebase
  - name: gcr.io/$PROJECT_ID/firebase
    args: ["deploy", "--project=$PROJECT_ID", "--only=hosting"]

Error

Already have image: node:14

> [email protected] test /workspace
> ng test "--watch=false"

- Generating browser application bundles (phase: setup)...
18 01 2022 19:22:45.740:INFO [karma-server]: Karma v6.3.11 server started at http://localhost:9876/
18 01 2022 19:22:45.744:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
18 01 2022 19:22:45.749:INFO [launcher]: Starting browser Chrome
18 01 2022 19:22:45.756:ERROR [launcher]: No binary for Chrome browser on your platform.
  Please, set "CHROME_BIN" env variable.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `ng test "--watch=false"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /builder/home/.npm/_logs/2022-01-18T19_22_45_880Z-debug.log

If you need headless chrome in your container, choose a container with node14 and headless chrome installed. I found this one with Chrome 89 and released 10 months ago. You could find better source I guess

Else, you can use your node:14 container and, if it's possible, install headless Google Chrome on it (something like that, install work, but I haven't node file to test on it to validate completely that example)

  - name: node:14
    entrypoint: bash
    args: 
      - -c
      - |
        wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
        apt update && apt install -y libappindicator1 fonts-liberation ./google-chrome-stable_current_amd64.deb
        npm run test -- --watch=false