简体   繁体   中英

installing @angular/compiler-cli, @angular/tsc-wrapped breaks karma-jasmine test

Running karma-jasmine test trowing an error, if @angular/compiler-cli installed. If I will not install @angular/compiler-cli test are working fine, but I need compiler-cli as I need to use ng-xi18n. If I remove @angular/tsc-wrapped , I can run tests, but cannot run 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'

package.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

The issue was not with @angular/tsc-wrapped, it was related with karma settings. Rearranging library loading and excluding 'node_modules/**/*spec.js' did the trick. I have also updated plinkr repo with the new settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM