Skip to content

Commit 2e46ad4

Browse files
authored
chore: bump version of composition api (#1583)
* chore: bump version of composition api * chore: run prettier
1 parent 73a869b commit 2e46ad4

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

docs/zh/guides/common-tips.md

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ it('render text', done => {
6565

6666
可以在[测试异步行为](../guides/README.md#测试异步行为)了解更多。
6767

68-
6968
### 断言触发的事件
7069

7170
每个挂载的包裹器都会通过其背后的 Vue 实例自动记录所有被触发的事件。你可以用 `wrapper.emitted()` 方法取回这些事件记录。

docs/zh/guides/getting-started.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ it('button click should increment the count', () => {
126126

127127
任何导致操作 DOM 的改变都应该在断言之前 await `nextTick` 函数。因为 Vue 会对未生效的 DOM 进行批量*异步更新*,避免因数据反复变化而导致不必要的渲染。
128128

129-
*你可以阅读[Vue 文档](https://cn.vuejs.org/v2/guide/reactivity.html#异步更新队列)了解更多关于异步指更新的信息。*
129+
_你可以阅读[Vue 文档](https://cn.vuejs.org/v2/guide/reactivity.html#异步更新队列)了解更多关于异步指更新的信息。_
130130

131131
在更新响应式 property 之后,我们可以直接 await 类似 `trigger``trigger.vm.$nextTick` 方法,等待 Vue 完成 DOM 更新。在这个计数器的示例中,设置 `count` property 会在运行下一个 tick 之后引发 DOM 变化。
132132

@@ -177,7 +177,6 @@ it('will catch the error using async/await', async () => {
177177

178178
### 接下来
179179

180-
181180
- 移步[编写测试的常见技巧](./README.md#明白要测试的是什么)以学习更多。
182181
- [选择一个测试运行器](./README.md#选择一个测试运行器)以把 Vue Test Utils 集成到你的工程里。
183182
- 学习更多[异步测试行为](./README.md#异步测试行为)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"devDependencies": {
9494
"@commitlint/cli": "^8.2.0",
9595
"@commitlint/config-conventional": "^8.2.0",
96-
"@vue/composition-api": "^0.3.2",
96+
"@vue/composition-api": "^0.6.4",
9797
"commitizen": "^4.0.3",
9898
"cz-conventional-changelog": "^3.0.2",
9999
"husky": "^3.1.0",

test/specs/mount.spec.js

+13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Vue from 'vue'
22
import { compileToFunctions } from 'vue-template-compiler'
33
import { mount, createLocalVue } from '@vue/test-utils'
4+
import CompositionAPI, { createElement } from '@vue/composition-api'
45
import Component from '~resources/components/component.vue'
56
import ComponentWithProps from '~resources/components/component-with-props.vue'
67
import ComponentWithMixin from '~resources/components/component-with-mixin.vue'
@@ -439,6 +440,18 @@ describeRunIf(process.env.TEST_ENV !== 'node', 'mount', () => {
439440
})
440441
})
441442

443+
it('works with composition api plugin', () => {
444+
const localVue = createLocalVue()
445+
localVue.use(CompositionAPI)
446+
const Comp = {
447+
setup() {
448+
return () => createElement('div', 'composition api')
449+
}
450+
}
451+
const wrapper = mount(Comp, { localVue })
452+
expect(wrapper.html()).to.equal('<div>composition api</div>')
453+
})
454+
442455
itDoNotRunIf.skip(
443456
vueVersion >= 2.5,
444457
'throws if component throws during update',

yarn.lock

+11-6
Original file line numberDiff line numberDiff line change
@@ -1860,12 +1860,12 @@
18601860
source-map "^0.5.6"
18611861
vue-template-es2015-compiler "^1.6.0"
18621862

1863-
"@vue/composition-api@^0.3.2":
1864-
version "0.3.2"
1865-
resolved "https://registry.yarnpkg.com/@vue/composition-api/-/composition-api-0.3.2.tgz#2d797028e489bf7812f08c7bb33ffd03ef23c617"
1866-
integrity sha512-fD4dn9cJX62QSP2TMFLXCOQOa+Bu2o7kWDjrU/FNLkNqPPcCKBLxCH/Lc+gNCRBKdEUGyI3arjAw7j0Yz1hnvw==
1863+
"@vue/composition-api@^0.6.4":
1864+
version "0.6.4"
1865+
resolved "https://registry.yarnpkg.com/@vue/composition-api/-/composition-api-0.6.4.tgz#b12a85183eecdbb18453efae28853edb77b4a625"
1866+
integrity sha512-WQUqp61c1WH5pAmbUM5xUBYZYWh3TV48h1jLl2pofidXGglTS9+bvCfHKTk0bsA/U5ZbzfUMa1IpQGUGdYZYeA==
18671867
dependencies:
1868-
tslib "^1.9.3"
1868+
tslib "^2.0.0"
18691869

18701870
"@webassemblyjs/[email protected]":
18711871
version "1.4.3"
@@ -12404,11 +12404,16 @@ trough@^1.0.0:
1240412404
version "1.0.1"
1240512405
resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.1.tgz#a9fd8b0394b0ae8fff82e0633a0a36ccad5b5f86"
1240612406

12407-
tslib@^1.9.0, tslib@^1.9.3:
12407+
tslib@^1.9.0:
1240812408
version "1.10.0"
1240912409
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
1241012410
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
1241112411

12412+
tslib@^2.0.0:
12413+
version "2.0.0"
12414+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.0.tgz#18d13fc2dce04051e20f074cc8387fd8089ce4f3"
12415+
integrity sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==
12416+
1241212417
1241312418
version "0.0.0"
1241412419
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"

0 commit comments

Comments
 (0)