ReferenceError: Can't find variable: Map

后端 未结 2 1825
滥情空心
滥情空心 2020-12-20 13:57

I\'m using Angular 4, Webpack 2.4.1, Karma 1.6 and Jasmine 2.6.1 and am writing ES2015 not TypeScript

I\'ve got a tiny angular demo app and I want to

2条回答
  •  伪装坚强ぢ
    2020-12-20 14:35

    This error is thrown because there's no Map in browsers. PhantomJS is used as Karma driver, and it doesn't support ES6 features.

    If polyfills (e.g. core-js) aren't loaded in files that were included in tests, they should be loaded separately, for example via karma-es6-shim plugin:

        ...
        frameworks: ['es6-shim', 'jasmine'],
        ...
    

提交回复
热议问题