【问题标题】:Phantomjs error while running tests in angular cli在 Angular cli 中运行测试时出现 Phantomjs 错误
【发布时间】:2017-03-07 04:35:53
【问题描述】:

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

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

【问题讨论】:

    标签: phantomjs angular-cli polyfills


    【解决方案1】:

    你需要从你的 polyfills.ts 中取消注释

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-11-09
    • 1970-01-01
    • 1970-01-01
    • 2015-03-21
    • 1970-01-01
    • 1970-01-01
    • 2015-07-17
    • 2011-01-25
    相关资源
    最近更新 更多