自 2.x 以来,异步测试的语法发生了变化,文档不清楚。
有人可以澄清我如何执行一些代码,阻塞 3 秒,然后使用新语法运行测试条件吗?
it('should update the table when new data is provided', function() {
var newData = ",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23\nX-Y,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
fixture.datum(csv).call(fp);
expect(fp.dataset()).toEqual(csv);
fp.dataset(newData);
expect(fp.dataset()).toEqual(newData);
//block for 3 seconds
expect(fixture.selectAll(".row").nodes().length).toBe(3);
});