Skip to content

Commit

Permalink
[#323] - polished 前端/2018-10-29-vue-application-unit-test-strategy-an…
Browse files Browse the repository at this point in the history
…d-practice-02-how-jest-work.md
  • Loading branch information
JimmyLv committed Oct 29, 2018
1 parent 95be28e commit b204438
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ window.matchMedia = jest.fn().mockImplementation(query => {

## 如何测试异步代码?

异步是 JavaScript 中绕不开的永恒话题,多亏了 ES6 + 高级语法所提供的多种优雅的异步代码方式,让我们写测试代码的方式也多了好多种。(逃
异步是 JavaScript 中绕不开的永恒话题,多亏了 ES6+ 高级语法所提供的多种优雅的异步代码方式,让我们写测试代码的方式也多了好多种。(逃

让我们先来看一下什么是异步请求,这里有一个通过 Chrome API 获取当前位置的实例,可想而知 Chrome 要根据 GPS 信号才能算出当前的经纬度,相当于从卫星🛰来回走了一遭,怎么不会异步(代表有延时,延迟返回)呢?

Expand Down

0 comments on commit b204438

Please sign in to comment.