茉莉花2.0异步()和角嘲笑同一测试注入()()

茉莉花2.0异步()和角嘲笑同一测试注入()()

问题描述:

我通常的测试用例看起来像

My usual test case looks like

it("should send get request", inject(function(someServices) {
     //some test
}));

和茉莉花2.0异步测试应该像

And Jasmine 2.0 async test should look like

it("should send get request", function(done) {
     someAsync.then(function(){
         done();
     });
});

如何使用这两种做,在一次测试中注入?

How can I use both done and inject in one test?

这应该工作;我遇到了同样的问题,当我更新到2.0茉莉花

This should work; I ran into the same problem when I updated to Jasmine 2.0

it("should send get request", function(done) {
    inject(function(someServices) {
        //some async test
        done();
    })
});