如何在瞬间时区使用柏树

问题描述

Cypress已将矩型库导入其API,并且可以由Cypress.moment(date)访问 https://docs.cypress.io/api/utilities/moment.html#Syntax

但是我需要在测试中使用moment-timezone而不是moment来在时区之间进行切换。 以前([email protected])的工作方式如下:

// cypress/support/index.js
Cypress.moment = require('moment-timezone');

但是自升级[email protected]以来,出现以下错误

TS2339: Property 'tz' does not exist on type '{ (...args: any[]): any; momentProperties: any[]; suppressDeprecationWarnings: boolean; deprecationHandler: any; parseTwoDigitYear(input: any): number; createFromInputFallback: any; ISO_8601(): void; ... 34 more ...; HTML5_FMT: { ...; }; }'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)