腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
4
回答
Jest
无法
加载下划线
、
获取错误
TypeError
:
无法
读取
未定义
的
属性
“”_“”运行
Jest
-React测试用例时。
浏览 3
提问于2018-02-09
得票数 9
2
回答
Jest
TypeError
:
无法
读取
JestAdapter中
未定义
的
属性
“bind”
、
、
、
Test suite failed to run at jestAdapter(node_modules/
jest
-circus/build/legacy-code-todo-rewrite/jestAdapter.js:30:56)属地 "
jest
": ",而且在一个特定<em
浏览 3
提问于2021-08-03
得票数 1
回答已采纳
1
回答
模拟jwt-在
Jest
中解码
、
、
我使用它
的
方式如下:然后在测试中尝试了以下内容,得到了如下错误:
TypeError
:
无法
读取
未定义
的
属性
“exp” exp: 123, <
浏览 1
提问于2020-02-25
得票数 7
回答已采纳
1
回答
Typescript中axios拦截器
的
Jest
模拟失败
、
、
我正在尝试在Typescript中使用
Jest
来模拟axios拦截器。但是,在运行时,我收到以下错误:axios.interceptors.request.use(async (config:AxiosRequestConfig) => {
jest
.mock('axios', ()
浏览 4
提问于2021-06-29
得票数 0
1
回答
错误:
无法
读取
属性
获取。使用
jest
-世博与反应本地
、
、
、
、
TypeError
:
无法
读取
未定义
的
属性
“提取” 在运行
jest
-expo测试时出错了。如果有人有解决办法,请分享。
浏览 3
提问于2017-11-04
得票数 14
1
回答
如何用玩笑和测试-库/反应测试屏幕方向?
、
、
、
、
我通过测试库/react和jestJs为nextJs中
的
组件编写了一个测试,并检查了"window.screen.orientation.type“。我得到了一个错误:"
TypeError
:
无法
读取
未定义
的
属性
(
读取
'type')“。我怎么解决这个问题?我怎么能嘲笑它来工作呢?我尝试使用
jest
.spyOn:
jest
.spyOn(window.screen,“取向”
浏览 4
提问于2022-11-08
得票数 0
回答已采纳
1
回答
在javascrip -
jest
中测试链接
属性
执行时出错
、
、
、
_id.toString() });const res = { json:
jest
.fn(),但我得到了
TypeError
:
无法
读取
属性
'json‘
的
未定义
。我用
Jest
做测试。我做错了什么?
浏览 2
提问于2020-04-22
得票数 0
3
回答
嘲笑window.sessionStorage
的
最好方法是什么?
、
、
、
、
下面是一个非常简单
的
jest
单元测试,在运行它时,您会得到类似的错误
TypeError
:
无法
读取
未定义
的
属性
“getItem” 但根据
的
最后两条评论,localStorage和sessionStorage已经被添加到最新
的
JSDOM和
jest
中。如果使用并将其添加到我
的
jest
setupFiles中
浏览 0
提问于2018-07-27
得票数 25
1
回答
使用“react test-renderer”-
无法
读取
未定义
的
属性
“hasOwnProperty”时出错
、
、
、
我试图在我
的
react应用程序中实现
Jest
,但是当我导入react-test-renderer时,我得到了错误消息:
TypeError
:
无法
读取
未定义
的
属性
'hasOwnProperty‘。我
的
App.test.jsx文件中唯一
的
一行是:错误
的<
浏览 3
提问于2019-12-20
得票数 3
1
回答
无法
读取
未定义
的
属性
“runCLI”在gulp
jest
中
、
、
从国家预防机制安装了这些软件包:"
jest
-cli": "^25.3.0""
jest
": { "<rootDir>/
jest
.setup.js" "collectCo
浏览 2
提问于2020-04-14
得票数 3
2
回答
返回
无法
读取
未定义
的
属性
“_isMockFunction”
、
、
返回不能
读取
未定义
的
属性
“_isMockFunction”。下面我编写了示例代码。const mockHistory = { pathname: "/home", push:
jest
.fn); it("should redirect page on click of submitResponse", () => {
浏览 6
提问于2020-06-08
得票数 0
回答已采纳
2
回答
如何在
jest
中测试模拟函数
的
返回值
、
、
我想在
jest
中测试模拟函数
的
返回值。{ fs.mkdirSync(".called", () => { }); expec
浏览 0
提问于2018-07-20
得票数 2
回答已采纳
2
回答
Jest
- afterEach() -带括号和不带括号
的
方法调用
、
、
这很可能是一个基本
的
Javascript问题,但我问它
的
上下文是一个使用
的
测试,因为这就是我遇到它
的
地方。以下是
jest
测试代码:import {cleanup} from 'react-testing-library'; import '
jest
-domthey are not relevant to this example and have been excluded to k
浏览 0
提问于2018-07-31
得票数 0
1
回答
TypeError
:
无法
读取
未定义
的
属性
“创建”(物质UI/酶)
、
、
、
、
TypeError
:
无法
读取
未定义
的
属性
“创建”node_modules/
jest
-environment-jsdom/node_modules/jsdom/lib/jsdom/
浏览 0
提问于2020-07-27
得票数 3
回答已采纳
1
回答
无法
读取
未定义
异常
的
属性
“transformFile”
、
、
、
、
捆绑失败:
TypeError
:
无法
读取
未定义
的
属性
“transformFile”{ "version, "start": "node node_modules/react-native/local-cli
浏览 3
提问于2019-12-01
得票数 0
回答已采纳
1
回答
使用带有类型文本
的
Jest
时
的
转换
、
当我在一个类型记录项目中使用
Jest
启动测试程序时,我有以下编译错误: "
jest
": { "transform&
浏览 0
提问于2018-03-08
得票数 3
1
回答
嘲笑crypto.Hmac不使用
jest
.mock()
、
、
、
我试图用jestjs框架来模拟nodejs
的
crypto模块。下面是我想要模仿
的
代码: app.js:.createHmac('sha256', API_TOKEN)}
jest
.mock('crypto', () => {
浏览 1
提问于2020-10-16
得票数 2
回答已采纳
2
回答
如何正确地模拟useLocation?
、
、
、
ExampleComponent';import { shallow } from 'enzyme'; ...
jest
.requireActual('react-router-dom'), useLocation: () => ({() =&
浏览 1
提问于2021-06-14
得票数 4
3
回答
如何在使用
jest
.mock('axios')时模拟拦截器?
、
、
、
在使用
jest
运行测试时,我具有基本
的
测试适应语法: let render expect(something).toBeInTheDocument(); 问题是我
的
代码中有拦截器,当使用
jest
命
浏览 11
提问于2020-02-26
得票数 13
回答已采纳
1
回答
Svelte -在
jest
单元测试期间
无法
从JSON文件中获取数据
、
、
、
、
在单元测试期间,当使用json文件执行svelte组件时,我会得到
未定义
的
错误。import data from '..const resheader = screen.getByText("Restaurants"); })
Jest
Config文件: "transform": { "^.+\\.js$": &
浏览 4
提问于2022-05-03
得票数 1
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
Visual Studio Code 1.25.1 发布,常规更新
PHP8还有半年就要来了,来看看有哪些新特性
1000个项目中前10名的JavaScript错误介绍
深入了解 Proxy 代理
一文了解“最好编程语言”PHP 必知的 16 个编程法则!
热门
标签
更多标签
云服务器
ICP备案
实时音视频
对象存储
即时通信 IM
活动推荐
运营活动
广告
关闭
领券