-
用酶模拟点击似乎没有更新父组件中的状态
我正在尝试在我运行的地方进行高级测试: <pre><code>describe("<App/>", () => { let wrapper; con -
Jest“mockResolvedValue”不适用于自定义模块?
<h4>square.js</h4> <pre><code>const multiply = require("./multiply"); const square = (n) => multiply(n, n); module.exports = sq -
SyntaxError:在 Jest 中使用具有 amcharts4 的组件运行测试时出现意外的令牌导出
<pre><code> export { System, system } from "./.internal/core/System"; ^^^^^^ SyntaxError: Unexpected token export > -
Octokit 库的笑话
我的代码是这样的, <pre><code>const octokit = new Octokit({ auth: process.env.auth, }); const queries = JSON.stringify(e -
如何对表单验证错误进行 Jest 测试?
我正在尝试测试登录表单验证错误: <pre><code><Form className='form' onSubmit={onSubmit} data-testid='fo -
具有异步方法的节点服务的 Jest 单元测试
我遇到了以下错误。为什么我会收到来自服务的 <code>undefined</code> 响应? 我提供模拟实现有什么问题吗 -
如何修复 TypeError:navigation.setOptions 不是函数
我正在尝试对我的应用实现带有玩笑的本机测试库。 现在我的组件上的导航有问题。 当我运 -
ES6 导入在没有 Babel 的情况下不适用于 Jest
<h4>app.js</h4> <pre><code>export const temp = "Hello World"; </code></pre> <h4>app.test.js</h4> <pre><code>import { temp } from  -
我如何用玩笑测试异步获取功能
谁能告诉我我是如何用jest测试这个功能的 <pre><code>export function handleSubmitTest() { const postData = async ( u -
我不确定是什么阻止了这个测试用例,目前它进入了无限循环
我需要运行这个测试用例,但目前它陷入了无限循环。这是简约的代码,任何建议表示赞赏。 Test.t -
如何用开玩笑的方式在 kafka 中测试发送消息?
<pre><code>export const produce = async (topic: string, url: string): Promise<void> => { await producer.connect(); await prod -
如何在自定义错误类 (Typescript) 中为 super 编写测试
我正在为自定义错误类编写测试并希望涵盖所有行,但我不确定如何测试超级调用,我还想在创建时返 -
在反应测试库中测试 useEffect + jest
<strong>目标</strong> 我正在尝试测试 useEffect 函数,该函数在点击后将关注按钮的文本更改为取消关