0

运行 karma-jasmine 测试会引发错误(如果@angular/compiler-cli已安装)。如果我不安装@angular/compiler-cli测试工作正常,但我需要编译器-cli,因为我需要使用 ng-xi18n。如果我删除@angular/tsc-wrapped,我可以运行测试,但不能运行 ng-xi18n。

28 11 2016 14:06:52.990:WARN [web-server]: 404: /base/typescript.js
28 11 2016 14:06:53.026:WARN [web-server]: 404: /base/typescript.js
28 11 2016 14:06:53.031:WARN [web-server]: 404: /base/fs.js
28 11 2016 14:06:53.053:WARN [web-server]: 404: /base/path.js
    '(SystemJS) XHR error (404 Not Found) loading http://localhost:9876/base/typescript.js
                Error loading http://localhost:9876/base/typescript.js as 
    "typescript" 
from http://localhost:9876/base/node_modules/@angular/tsc-wrapped/test/collector.spec.js'

包.json:

.....
"dependencies": {
    "@angular/common": "2.2.3",
    "@angular/compiler": "2.2.3",
    "@angular/core": "2.2.3",
    "@angular/forms": "2.2.3",
    "@angular/http": "2.2.3",
    "@angular/platform-browser": "2.2.3",
    "@angular/platform-browser-dynamic": "2.2.3",
    "@angular/upgrade": "2.2.3",
    "@angular/router": "3.2.3",
    "core-js": "2.4.1",
    "reflect-metadata": "0.1.8",
    "rxjs": "5.0.0-beta.12",
    "systemjs": "0.19.39",
    "zone.js": "0.6.25",
    "bootstrap": "3.3.7"
  },
  "devDependencies": {
    "@angular/compiler-cli": "2.2.3",
    ....

http://plnkr.co/edit/x3tZ1Vm8WNt0WYGv2Dt7?p=preview

4

1 回答 1

0

问题不在于@angular/tsc-wrapped,它与业力设置有关。重新安排库加载和排除'node_modules/**/*spec.js'就可以了。我还使用新设置更新了 plinkr 存储库。

于 2016-11-29T10:57:36.227 回答