jest

    2热度

    3回答

    我试图用Jest在我的react/react-native库(只有一些业务逻辑里面)上运行一些测试。 我们正在测试使用获取函数(使用whatwg-fetch进行填充)的操作。 我已经添加了whatwg-fetch(感谢Safari)的反应。 每当我试图运行一个测试,我得到这个错误: TypeError: Cannot read property 'fetch' of undefined

    2热度

    1回答

    我的玩笑测试用例是类似于: test('should update state.focus', async() => { let component = getComponent() component.setState({focus: true}) expect(component.state().focus).toEqual(true) componen

    6热度

    1回答

    我尝试测试我的反应组件呈现,但得到下一个错误:不变冲突:_registerComponent(...):目标容器不是DOM元素。 如果我更改后面在document.body上渲染我的组件的位置,则不存在错误,并且如果此位置是某个div与正文中的某个ID,则存在该错误。 这里我的组件:该组件 import React from 'react' import {shallow, mount} fro

    1热度

    1回答

    我写的用玩笑我的机器人的考验,我有以下代码: let bot; let conn; let index = 0; let responses = []; let expectedResponses = []; beforeEach(() => { let connector = new builder.ConsoleConnector(); bot = new bu

    0热度

    1回答

    我试图使用脚本查询来更新特定的文件,但不能肯定我需要查询 这里与更新使用开玩笑客户端,它的工作的哪班是我的代码 String h = " { " + " \"script\": { \n" + " \"inline\": \"ctx._source.order=params.prasad\", \n " + "\"params\": { \"pras

    0热度

    1回答

    我试图用JEST for React设置单元测试。 我的当前设置里面的package.json: "jest": { "transform": { "^.+\\.jsx?$": "babel-jest" }, "moduleFileExtensions": [ "js", "json", "jsx" ] } 然后里面.babelrc我: {

    0热度

    1回答

    我正在使用jest来测试我的reactjs应用程序。它工作正常,但jest不给我一个关于测试用例结果的好报告。 jest的输出显示了每个测试套件的输出。我有50多个测试套件,我很难向上滚动查看每个失败的测试用例。是否有简短的jest报告,其中打印了关于整个测试用例的简要概述?下面 是我jest.conf文件: { "testRegex": "/tests/.*\\.test\\.jsx?

    0热度

    1回答

    我有一个文件,这个功能 export const doSomething = (arg1, arg2) => { SomeClass.someFunction() OtherClass.otherFunction() } 我在人们如何模拟的东西上网看了一下,但没有人解决了我的情况。基本上我在开玩笑测试,我想打电话给 test('sendText to send text

    13热度

    4回答

    我正在写一个反应的应用程序,并用笑话测试它。但是,每当我从终端运行jest命令时,我都会出现此错误。 TypeError: projects.map is not a function at Object.<anonymous> (/Users/DavidHu/Desktop/coding/projects/swapnow/node_modules/jest-cli/build/cli/

    0热度

    1回答

    我已经测试通过包括这条线在我的测试文件的顶部,茉莉(库测试)和笑话(快照测试)合格: /// <reference path="../../node_modules/@types/jasmine/index.d.ts" /> // -> in my jest test files /// <reference path="../../node_modules/@types/jest/inde