介绍 核心概念 1. 入口(Entry) 2. 出口(Output) 3. Loader 4. 插件(Plugins)

介绍 核心概念 1. 入口(Entry) 2. 出口(Output) 3. Loader 4. 插件(Plugins)
在编写测试时,通常需要在测试运行之前进行一些设置工作,并且需要在测试运行后进行一些完成工作。 Jest提供帮助函数来处理这个。 如果你有一些工作需要多次测试,你可以使用bef...
JavaScript中经常有异步运行的代码。如果你要测试异步的代码,Jest需要知道他测试的代码是否已经完成异步动作,然后才可以进行测试。Jest有这几种方法来处理这个问题。...
In this article we will discuss how to use Higher Order Components to keep your React a...
你也可以使用Jest的“匹配器”来测试数据。有很多不同的匹配器,所以这篇文章只会介绍最常用的几种。 普通匹配 最简单的的测试方法就是看两个比较值是否相等: test('2加2...
创建一个项目文件加 jestTest mkdir /.../jestTest 进入 jestTest文件夹 cd /.../jestTest 通过npm安装 jest npm...
Once your website or application goes past a small number of lines, it will inevitably ...
Components can refer to other components in their output. This lets us use the same com...
Previously, we only encountered React elements that represent DOM tags: 以前,我们只会遇到表示DOM标...
React elements are immutable. Once you create an element, you can't change its children...
Components let you split the UI into independent, reusable pieces, and think about each...
The simplest way to define a component is to write a JavaScript function: 定义一个组件最简单的方法是...
Let's say there is a somewhere in your HTML file: 假设你的HTML文件里面有一个 : We call this a ...
Elements are the smallest building blocks of React apps. 元素是构建React应用的最小块。 An element d...
React DOM compares the element and its children to the previous one, React DOM将元素及其子元素与...
You may use quotes to specify string literals as attributes: 你可以使用引号指定字符串作为属性: const el...