当我尝试使用命令运行测试时,我尝试使用 gitlab-ci 和节点 docker 映像构建一个小型 Angular 应用程序 npm run test 它失败并出现以下错误:
ERROR [launcher]: No binary for Chrome browser on your platform. Please, set "CHROME_BIN" env variable.
gitlab-ci.yml
stages:
- build
variables:
NPM_CONFIG_REGISTRY: https://test.com/xx/api/npm/npm-all
build:
stage: build
image: node:12.9
script:
- npm install
- npm run build:prod
- npm run test
tags:
- DOCKER
在上面的代码中npm run test按照package.json中的配置执行ng test
我能够运行构建,但是当我运行测试时,它会寻找 chrome 浏览器,我还尝试使用以下命令以无头方式运行测试,但导致相同的错误:
ng test --no-watch --browsers=ChromeHeadless
如何将 chrome 功能添加到此版本中?