Jasmine clock tick & Firefox: failing to trigger a Q.delay method

爱⌒轻易说出口 提交于 2019-12-06 10:24:44

With jasmine 2.0 and Q at the v1 tag, I'm able to run this spec:

describe("testing", function() {
  beforeEach(function() {
    jasmine.clock().install();
  });

  afterEach(function() {
    jasmine.clock().uninstall();
  });

  it("should work", function() {
    var foo = null;
    Q.delay('hi', 10000).then(function(arg) {
      foo = arg;
    });
    jasmine.clock().tick(10010);
    expect(foo).toEqual('hi');
  });
});

With no problems in both chrome, firefox, and phantomjs. I'm not sure if this is because we've fixed this issue in 2.0 or if you have some more complicated spec, that I'm not replicating here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!