Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
模拟节点外部模块默认使用 jest 的链式方法
在我们的节点 CLI 中 我们有一个简单的方法 use strict const ora require ora module exports function startSpinner textOnStart color spinnerT
javascript
nodejs
jestjs
如何使用 jest 通过 Promise.all 设置多次提取测试
我在测试中使用 jest 我正在使用 React 和 Redux 并且执行以下操作 function getData id notify return dispatch gt dispatch anotherFunction Promise
javascript
ReactJS
Testing
redux
jestjs
如何使用 TypeScript、Jest 和 Enzyme 测试 React 中的按钮点击
我正在使用 TypeScript 构建一个 React Native 应用程序 我正在使用 Jest 和 Enzyme 进行组件测试 我也在使用 React 导航 我正在努力编写单击按钮的单元测试 这是组件的代码 只是渲染函数 render
typescript
ReactNative
jestjs
reactnavigation
enzyme
玩笑错误 TypeError: (0 , _jest.test) 不是函数
我收到错误 类型错误 0 jest test 不是一个函数 当尝试使用时npm test 我认为这可能与配置有关 我该如何解决这个问题 File sum js function sum a b return a b export defau
javascript
ReactJS
jestjs
firebase.storage() 不是玩笑测试用例中的函数
我正在使用 Jest 来测试我的 firebase 功能 这一切都在浏览器中进行 因此我与服务器端的 firebase 没有任何冲突 当我使用firebase auth or firebase database 一切正常 当我尝试使用时fi
javascript
firebase
firebaseauthentication
firebasestorage
jestjs
开玩笑错误意外的令牌...(ES6)
每当我在命令行中运行 jest 时 都会收到以下错误 Test suite failed to run Users
javascript
ReactJS
unittesting
ECMAScript6
jestjs
使用 xhr-mock 测试 AJAX 函数失败
我正在尝试从我的中测试以下功能network js export function post data return new Promise function resolve reject need to log to the root v
javascript
jestjs
如何使用 Jest 测试 swiper?
我正在使用 Jest 创建 Swiper 的单元测试 这是我的代码 https codesandbox io s swiper default react forked v0dnz file src App test jsx https c
jestjs
swiperjs
在 Jest 测试中设置时刻时区
我有 util 函数 它以特定的日期格式解析给定的日期 即 2019 01 28 然后使用momentJS检索当天的开始并将其转换为 ISO 日期格式 dates js import moment from moment export co
javascript
date
mocking
jestjs
Momentjs
包子路径'./src/ngtsc/reflection'不是由/node_modules/@angular/compiler-cli/package.json中的“exports”定义的
我正在尝试用 jest 运行 ng 测试并收到以下错误 Package subpath src ngtsc reflection is not defined by exports in Users oyf992 source app mn
angular
unittesting
Testing
jestjs
安装react-native-async-storage后玩笑测试失败
在我的React Native项目中 我最近安装了节点模块react native async storage 因为我收到了有关 react native 的本机包已被弃用并移出到单个模块的警告 安装后 react native commu
ReactNative
jestjs
babeljest
如何在 React 中使用 Jest 模拟 window.location.href?
我正在测试不应该在本地运行并且需要模拟的功能window location href const usePageTracking void gt const location useLocation useEffect gt if wind
ReactJS
Testing
jestjs
reactHooks
mocking
CI 中带有打字稿路径的玩笑“找不到模块”
在 Gitlab CI 环境中 我们的 Jest 测试中有 2 个失败 并显示Cannot find module 奇怪的是 它可以在我本地的 Win10 机器上运行 即使我在类似的 docker container 中运行测试 node
jestjs
tsconfig
tsjest
nrwlnx
使用 Jest 和 Testbed 测试 Angular 9 服务
在我的 Angular 9 项目中我添加了jest并删除Jasmine and Karma 我正在测试一项名为CorrectionService依赖于一个名为的服务RemoteService 我想监视RemoteService查看是否调用了
angular
unittesting
jasmine
jestjs
使用 jest 存根函数
有没有办法使用 jest API 来存根函数 我习惯于使用 sinon 存根 在这里我可以使用存根为来自我的测试单元的任何函数调用编写单元测试 http sinonjs org releases v1 17 7 stubs http sin
unittesting
mocking
jestjs
sinon
React Native + Jest EMFILE:打开文件太多错误
我正在尝试运行 Jest 测试 但收到以下错误 读取文件时出错 Users mike dev react TestTest node modules react native node modules yeoman environment
ReactJS
ReactNative
jestjs
ulimit
如何将 Enzyme Shallow 与 Jest 快照结合使用
我正在尝试使用shallow https github com airbnb enzyme blob master docs api shallow md from enzyme https github com airbnb enzyme
javascript
ReactJS
unittesting
jestjs
enzyme
玩笑测试因 refs 和 Form 失败
我有一个搜索栏组件 如下所示 render const onChangeTextInput this props return
javascript
ReactJS
ReactNative
jestjs
enzyme
如何使用 msw 有条件地模拟错误响应
我正在处理的 UI 根据收到的响应以不同的方式呈现 我想测试用户界面4xx and 5xx收到答复 我的 api 处理程序看起来像 import rest from msw import items from apiValues expor
ReactJS
Testing
jestjs
msw
如何测试从父组件传递的子组件中的回调单击?
我有以下父组件 import React Fragment from react export class Parent extends Component constructor props super props this state
javascript
ReactJS
jestjs
enzyme
1
2
3
4
5
6
...25
»