jest报错:jest-jasmine is no longer shipped by default with Jest, you need to install it explicitly

公司的前端自动化项目使用的jest框架,已经通过yarn add --dev jest安装了jest,

执行自动化脚本

package.json中如下

 "scripts": {

    "start_one":"jest --runInBand --forceExit --update=true --downloaXXXXX后面的省略掉"

}

进入自动化项目命令行 yarn start_one,报错如下:

jest-jasmine is no longer shipped by default with Jest, you need to install it explicitly or provide an absolute path to Jest

  Configuration Documentation:
  https://jestjs.io/docs/configuration

使用全局安装jest, yarn global add jest,再次执行,问题还在

求助求助,

另外怎么把jest添加系统变量PATH中,真不会阿(安装jest后的路径D:\programs\node_modules\@jest)

20230915:

TimeoutError: Navigation timeout of 30000 ms exceeded

  at LifecycleWatcher._LifecycleWatcher_createTimeoutPromise (node_modules/puppeteer-core/src/common/LifecycleWatcher.ts:258:12)
 

解决方案:

const browser = await puppeteer.launch({ timeout: 60000, // 设置超时时间为 60 秒 });

或者

const browser = await puppeteer.launch(); const page = await browser.newPage(); const auditUrl = 'https://example.com'; await page.goto(auditUrl, { timeout: 60000 });

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值