Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phantomjs error while running tests in angular cli

I am trying to run ng test in Angular Cli project using phantom browser and I am getting below error. I googled it and realized that it has something to do with polyfill (Backward compatibility?). I want to understand what's wrong here and how to fix this issue. Thanks in advance!

PhantomJS 2.1.1 (Windows 7 0.0.0) ERROR TypeError: undefined is not an object (evaluating '(_a = ((Object))).assign.apply') at webpack:///~/@angular/common/src/pipes/intl.js:187:0 <- src/test.ts:34449

like image 588
user911 Avatar asked Mar 07 '17 04:03

user911


1 Answers

you need to uncomment those from your polyfills.ts

import 'core-js/es6/object';
import 'core-js/es6/array';
import 'intl';  // Run `npm install --save intl`.
like image 79
Chuck Mah Avatar answered Nov 10 '22 09:11

Chuck Mah