0

Recently upgraded to angular 11 and stumbled upon an issue during running npm test in my gitlab pipeline, the issue is only when running npm test, npm build prod seems to work fine.

Below information about the env.

Deploy image has Node 14 LTS

angular CLI: 11.0.5

Target:es5

I've tried to run ng test with more memory, it didn't help

node --max_old_space_size=5000 ./node_modules/@angular/cli/bin/ng test --code-coverage

noticed when changing the target to es2015 or es6 npm test seems to work, but I don't want to make this change is causing some other functionality to break in my application.

Here's a screenshot of the error: error

Nico Levi
  • 53
  • 4
  • 12

2 Answers2

0

The fix was turning off source maps for the tests by: ng test -sm=false

Nico Levi
  • 53
  • 4
  • 12
0

Try to run these two commands below in the root of your project:

  1. npm i -g increase-memory-limit
  2. increase-memory-limit