私はdocumentation for testing Angular 1.5 componentsに従っています。
$ componentControllerが未定義のエラーが表示されます。私はそれが何かシンプルだと確信していますが、私はここで何が間違っているかを見ることはできません
ここは私のテストコンポーネントです。ここで
class MyComponent {
constructor() {
this.counter = 0;
}
$onChanges() {}
$onDestroy() {}
addToCounter() {
this.counter += 1;
}
}
MyComponent.$inject = [];
angular.module('my.component', [])
.component('MyComponent', {
controller: MyComponent,
bindings: {},
template: `
<div>Hello World</div>
`,
});
はジャスミンはまず
LOG: '$componentController', undefined
...
TypeError: undefined is not a constructor (evaluating '$componentController('MyComponent', null, bindings)') in ...
テスト用に正しい角度と角度のモックがインストールされていますか? – Chris
はい両方の角度1.5.9 –
コードに問題がなければ、設定をもう一度確認します。 –