运行 在 angular cli 中测试时出现 Phantomjs 错误

Phantomjs error while running tests in angular cli

我正在尝试使用 phantom 浏览器在 Angular Cli 项目中 运行 ng 测试,但出现以下错误。我用谷歌搜索了一下,发现它与 polyfill(向后兼容?)有关。我想了解这里出了什么问题以及如何解决此问题。提前致谢!

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

您需要取消对 polyfills.ts

中的注释
import 'core-js/es6/object';
import 'core-js/es6/array';
import 'intl';  // Run `npm install --save intl`.