【发布时间】:2019-08-08 23:47:22
【问题描述】:
如何在 StencilJS E2E 测试中将 CustomEvent 分派给元素:
const page = await newE2EPage({html: `<my-component></my-component>`});
let component = await page.find('my-component');
?? component.dispatch(new Event('my-event'));
在上面的代码中,我尝试将 customEvent 分派给我的组件,以便测试它是否正确响应。但我在 newE2EPage 中看不到任何这样做的方法。有什么建议吗?
【问题讨论】:
标签: typescript web-component e2e-testing stenciljs