1
我想爲我的<rating>
組件(lib/rating/rating.dart/html
)編寫單元測試(test/src/rating/rating.html/dart
)。測試角度組件
void main() {
useHtmlEnhancedConfiguration();
ng.Scope _rootScope;
dom.Element _element;
ngMock.TestBed _tb;
setUp(() {
try {
ngMock.setUpInjector();
ngMock.module((ng.Module module) {
module.install(new RatingModule());
});
ngMock.inject((ng.Scope scope, ngMock.TestBed testBed) {
_rootScope = scope;
_rootScope['rate'] = 3;
_tb = testBed;
_element = _tb.compile('<rating value="rate"></rating>', scope: _rootScope);
_rootScope.$digest();
});
print('setUp done');
} catch(e) {
print(e);
}
});
線_element = _tb.compile('<rating value="rate>...
失敗
[意想不到的請求:GET包/ bootstrap_angular /評級/ rating.html
我改變了組件templateUrl到模板,並指定模板HTML作爲字符串並擺脫了異常。
我做錯了什麼或者這是不是(支持)?