【发布时间】:2015-06-27 18:53:17
【问题描述】:
我正在尝试弄清楚如何使用 Jasmine 测试 Reflux 商店 (https://github.com/spoike/refluxjs)。基本上,这个问题的等价物,除了我所知道的runAllTimes没有等价物:How to test Reflux actions with Jest
it('responds to the doTheThing action and triggers afterward', function() {
var spyFn = jasmine.createSpy('spy');
MyStore.listen(spyFn);
MyActions.doTheThing();
// with Jest, I would call jest.runAllTimers() here
expect(spyFn).toHaveBeenCalled();
});
^ 这失败了,它应该返回 true。
那么:有人知道如何使用 Jasmine 测试 Reflux 商店吗?
【问题讨论】: