Search code examples
angularazure-devopsgoogle-chrome-headless

Angular/ChromeHeadless unit tests fail on Visual Studio Online


I have a Angular7 application with UnitTests. I'm running them succesfully on my local machine with

ng test --source-map=false --watch=false --browsers=ChromeHeadless"

But when I run the CI pipline on VisualStudioOnline (AzureDevOps), the same command just returns with

2018-11-06T10:50:29.3023236Z ##[error]Error: Npm failed with return code: 1

The only (small) difference is the node/npm version Local: Node 8.11.1 / NPM 6.1.0 VSOnline: Node 8.12.0 / NPM 6.4.1


Solution

  • Well, to close this issue... Always be aware about all the console.log's in Chrome. With headless in Azure, it's not the most comfortable way to analyize this. But running the tests locally with browser support makes it easier.