1
角度のあるcliで作成されたプロジェクトがあります。私はcliで新しいコンポーネントを生成し、次のスタックでPhantomJSを使用すると最も基本的なテストでさえ失敗します。ジャスミンユニットテストはChromeで実行されますが、PhantomJでは実行されません。
× should create an instance
PhantomJS 2.1.1 (Windows 8 0.0.0)
Failed: undefined is not a constructor (evaluating 'attr.name.startsWith(_I18N_ATTR_PREFIX)')
http://localhost:9876/_karma_webpack_/vendor.bundle.js:48660:70
[email protected][native code]
[email protected]://localhost:9876/_karma_webpack_/vendor.bundle.js:48660:24
[email protected]://localhost:9876/_karma_webpack_/vendor.bundle.js:48603:32
[email protected]://localhost:9876/_karma_webpack_/vendor.bundle.js:40053:62
http://localhost:9876/_karma_webpack_/vendor.bundle.js:48595:59
[email protected][native code]
[email protected]://localhost:9876/_karma_webpack_/vendor.bundle.js:48594:31
[email protected]://localhost:9876/_karma_webpack_/vendor.bundle.js:40053:62
http://localhost:9876/_karma_webpack_/vendor.bundle.js:48595:59
[email protected][native code]
[email protected]://localhost:9876/_karma_webpack_/vendor.bundle.js:48594:31
[email protected]://localhost:9876/_karma_webpack_/vendor.bundle.js:40053:62
http://localhost:9876/_karma_webpack_/vendor.bundle.js:48595:59
[email protected][native code]
[email protected]://localhost:9876/_karma_webpack_/vendor.bundle.js:48594:31
私は、npmパッケージの組み合わせにいくつかの互換性がないと思われます。ここに私のpackage.jsonです
"dependencies": {
"@angular/animations": "^5.0.2",
"@angular/common": "^5.0.2",
"@angular/compiler": "^5.0.2",
"@angular/core": "^5.0.2",
"@angular/forms": "^5.0.2",
"@angular/http": "^5.0.2",
"@angular/platform-browser": "^5.0.2",
"@angular/platform-browser-dynamic": "^5.0.2",
"@angular/router": "^5.0.2",
"angularfire2": "^5.0.0-rc.4",
"core-js": "^2.4.1",
"crds-styles": "^1.3.1",
"firebase": "^4.6.2",
"intl": "^1.2.5",
"ng2-toastr": "^4.1.2",
"ngx-bootstrap": "1.9.3",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.5.4",
"@angular/compiler-cli": "^5.0.2",
"@angular/language-service": "^5.0.2",
"@types/jasmine": "2.5.38",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.89",
"codelyzer": "^4.0.1",
"firebase-tools": "^3.15.4",
"jasmine-core": "~2.6.0",
"jasmine-spec-reporter": "~4.2.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-mocha-reporter": "2.2.4",
"karma-phantomjs-launcher": "^1.0.4",
"karma-teamcity-reporter": "^1.0.0",
"prettier": "^1.9.2",
"protractor": "~5.1.2",
"replace": "^0.3.0",
"ts-node": "~2.0.0",
"tslint": "~5.7.0",
"tslint-config-prettier": "^1.6.0",
"typescript": "2.5.3"
}
アイデア?
テスト前にES5に移すことはできますが、phantomjsは[これ以上管理されません](https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuNE)何かに切り替える。 – ext