提交 b8f34080 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test(video format): 调整 isError 数据,支持测试

上级 21fd702c
...@@ -85,12 +85,13 @@ ...@@ -85,12 +85,13 @@
} }
] as Array<VideoFormat>) ] as Array<VideoFormat>)
let isError = false // 自动化测试 // 自动化测试
const isError = reactive({value: false})
const onError = (format : string, e : UniVideoErrorEvent) => { const onError = (format : string, e : UniVideoErrorEvent) => {
console.log(format + ":" + JSON.stringify(e)); console.log(format + ":" + JSON.stringify(e));
if (format != "错误路径") { if (format != "错误路径") {
isError = true; isError['value'] = true;
} }
} }
......
...@@ -214,6 +214,6 @@ describe('component-native-video', () => { ...@@ -214,6 +214,6 @@ describe('component-native-video', () => {
it('test format', async () => { it('test format', async () => {
page = await program.navigateTo('/pages/component/video/video-format'); page = await program.navigateTo('/pages/component/video/video-format');
await page.waitFor(1000); await page.waitFor(1000);
expect(await page.data('isError')).toBe(false); expect((await page.data('isError')).value).toBe(false);
}); });
}); });
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册