我正在使用 Karma + Mocha 通过异步调用测试 AngularJS 服务。我将如何告诉测试我已完成异步调用 - 即标准 Mocha done() 函数在哪里?
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()
});
}));
});
});