小编ank*_*pta的帖子

React 测试库覆盖延迟加载

如何覆盖react测试库中的延迟加载组件。

import React, {lazy} from 'react';
const ownerInfo = lazy(() => import('../abc'))

const compone = () => {
  return <Suspense><abc /></Suspense>
}
export default compone
Run Code Online (Sandbox Code Playgroud)

测试规范.js

 import React from 'react'
 import {render, fireEvent} from '@testing-library/react'
 import configureStore from 'redux-mock-store'

 ...
Run Code Online (Sandbox Code Playgroud)

reactjs jestjs redux-mock-store react-testing-library react-hooks

11
推荐指数
2
解决办法
2万
查看次数

增加firebase 3中重置密码链接的到期时间

目前我正在使用> 3版本的firebase SDK.

在新的api中,auth.sendPasswordResetEmail发送邮件中的重置链接,该链接将在2-3小时后到期.

是否可以像旧版本一样启用24小时?如果是的话,怎么样?

firebase firebase-authentication

9
推荐指数
1
解决办法
1563
查看次数

对象不是vuejs中的可扩展错误

我想用名为colspan的新字段更新促销对象.但是我的运气不好

错误:

未承诺(在promise中)TypeError:无法添加属性colspan,对象在eval(eval at(http:// localhost:8080/app.js:3160:1),:71:32)处无法在Array.forEach(原生地)进行扩展)eval(eval at(http:// localhost:8080/app.js:3160:1),:66:35)在eval的Array.forEach(native)(eval at(http:// localhost:8080 /) app.js:3160:1),:64:47)在eval上的Array.forEach(native)(eval at(http:// localhost:8080/app.js:3160:1),:62:23 )at at在F(Eval at(http:// localhost:8080/app.js:865:1),:35:28)的Promise()at Object.modifyData(eval at(http:// localhost:8080/app.js) :3160:1),:48:12)

departmentIds.forEach(departmentId => {
          results[departmentId] = []
          departmentWiseResults[departmentId].forEach((promo, index) => {
            let tmpPromo = promo
            dateRanges.dateRanges.forEach(range => {
              let startedDateWeek = moment(promo.startDate).week()
              let endDateWeek = moment(promo.endDate).week()
              let startedYear = moment(promo.startDate).year()
              let endedYear = moment(promo.endDate).year()
              tmpPromo.colspan = 0
              if (range.startYear === startedYear && range.endYear === …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js vuex

3
推荐指数
1
解决办法
2408
查看次数