typescript - 如何定义赛普拉斯任务返回类型的类型?
问题描述
我的目标是为我的 cypress 任务定义类型,用 typescript 编写。
当我使用自定义任务时,我目前有这个:
cy.task('customTask').then(v => {
// v is undefined here - how can I configure types?
});
插件/index.ts
module.exports = (on) => {
on('task', {
customTask: () => {
return 23;
}
});
}
解决方案
推荐阅读
- java - 如何使用'MOCKITO_CORE when'在junit测试用例中传递void返回类型
- python - 蛮力法算法python
- javascript - 如何找到 2 个动态创建的 div 类
- android - Retrofit/Gson 将 \n 添加到大字符串中
- javascript - 通过 AJAX 将值传递给控制器,无需使用 Thymeleaf 进行任何用户输入
- flutter - 无法解析配置“:classpath”的所有工件。无法解析 org.jetbrains.kotlin:kotlin-reflect:1.2.71
- node.js - 我如何在node.js中使用多个参数rest api
- laravel - 阻止特定角色的用户访问路由
- amazon-sns - AWS SNS 通知本地运行的 CLI 应用程序
- python - 用 enumerate 在第 n 行做某事