博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[React Testing] Confidently Ship Production React Apps
阅读量:7229 次
发布时间:2019-06-29

本文共 995 字,大约阅读时间需要 3 分钟。

 

We want to make sure that when we ship new code, our users can use the application. The best way we've found to do that is to write automated tests that run before we deploy a new version of the app. But if our tests aren't doing exactly what the user will do, then how do we really know that things will work when users interact with our apps?

Let's rethink what it means to ship applications with confidence and what it takes to get there. With improved tools and practices, we can be more certain that what we're shipping to our users will work the way it's intended.

Additional resources: , , , 

 

The workflow to test a lgoin form:

 

Test with react-testing-library: It provides some utities functions, such as getByLabelText, getByText, getByTestId together with data-testid attr in the dom.

The whole idea is not testing according to the implemention detail, but accroding what user will do.

 

Async:

'waitForElement' function can provide a easy way to test async code to opreate the DOM element

 

转载地址:http://hsdfm.baihongyu.com/

你可能感兴趣的文章
IT系统架构设计
查看>>
Nginx虚拟主机配置实践(一)
查看>>
细谈Spring(一)spring简介
查看>>
网络工程师的面试题
查看>>
nginx启动脚本
查看>>
常用输入法框架简介
查看>>
记录新机房建设。20130629
查看>>
安装ntop
查看>>
ssh远程登录讲解
查看>>
mysql的备份脚本
查看>>
linux下mysql的root密码忘记解决方法
查看>>
7.索引的性能分析
查看>>
在 Delphi 下使用 DirectSound (17): 频率均衡效果器 IDirectSoundFXParamEq8
查看>>
文件操作命令一cp 2
查看>>
Multi-Mechanize工程目录结构说明
查看>>
halt
查看>>
标准ACL+扩展ACL+命名ACL
查看>>
Meteor应用的启动过程分析
查看>>
九曲黄河万里沙,浪淘风簸自天涯 — 正则表达式
查看>>
欲哭无泪,联想笔记本性价比
查看>>