3
我正在使用Karma + Mocha來測試具有異步調用的AngularJS服務。我將如何去告訴測試我已完成異步調用 - 即標準的Mocha done()函數在哪裏去?與Karma和Mocha的異步測試
var should = chai.should();
describe('Services', function() {
beforeEach(angular.mock.module('myApp'));
describe('sampleService', function(){
it.only('should return some info', angular.mock.inject(function(sampleService) {
sampleService.get(function(data) {
data.should.equal('foo');
//done()
});
}));
});
});