-1
- 我想学习角js和茉莉花测试用例。
- 所以我拿了一个样本茉莉花测试用例,并在我的代码示例测试用例小提琴
- 中使用它,但在我的小提琴中,当我包括它的打破。
- 在我的控制台我看到错误,但不知道为什么它的发生
- Uncaught ReferenceError: System is not defined
- Uncaught TypeError: angular.module is not a function
- RangeError: Maximum call stack size exceeded*
- 你能告诉我如何解决它
- 提供以下
http://jsfiddle.net/v3gdnLwu/茉莉花测试案例不在我的小提琴执行
我的代码describe('myApp', function() {
var element,
name = 'Homer';
beforeEach(function() {
module('myApp');
element = angular.element('<my-drtv/>');
inject(function ($rootScope, $compile) {
var scope = $rootScope.$new();
scope.name = name;
$compile(element)(scope);
scope.$digest();
});
});
it('says hello', function() {
expect(element.text()).toBe('Hello Homer');
});
});