我今天试图在类似的情况下使用它:
group('some group', (){
//prints
setUp(() => print('set up'));
test('some test', (){
window.requestLayoutFrame(
expectAsync0((){
Expect.isTrue(true);
})
);
});
//doesn't print
tearDown(() => print('tear down'));
});
在这个例子中,似乎没有调用tearDown回调。
当我在单元测试之前放置tearDown()函数时,它会被调用,但输出序列不是我所期望的:
group('some group', (){
setUp(() => print('set up'));
tearDown(() => print('tear down'));
test('some test', (){
window.requestLayoutFrame(expectAsync0((){
print('in unit test');
Expect.isTrue(true);
}));
});
});
收率:
set up
tear down
in unit test
PASS: some group some test
拆卸前单位是否应测试输出?
SDK build 9881