diff --git a/pages/component/video/video-format.uvue b/pages/component/video/video-format.uvue index a300328ee913ce38d3125457225532b655af9a77..348524ab530c5f4de118e9c26d6d3700556cc9a9 100644 --- a/pages/component/video/video-format.uvue +++ b/pages/component/video/video-format.uvue @@ -85,12 +85,13 @@ } ] as Array) - let isError = false // 自动化测试 + // 自动化测试 + const isError = reactive({value: false}) const onError = (format : string, e : UniVideoErrorEvent) => { console.log(format + ":" + JSON.stringify(e)); if (format != "错误路径") { - isError = true; + isError['value'] = true; } } diff --git a/pages/component/video/video.test.js b/pages/component/video/video.test.js index 15967b3af121d1be27c788ecd0acb5411ce97d1c..bb994e460f9449484589b779081199f0bd30d701 100644 --- a/pages/component/video/video.test.js +++ b/pages/component/video/video.test.js @@ -214,6 +214,6 @@ describe('component-native-video', () => { it('test format', async () => { page = await program.navigateTo('/pages/component/video/video-format'); await page.waitFor(1000); - expect(await page.data('isError')).toBe(false); + expect((await page.data('isError')).value).toBe(false); }); });