We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f592acc commit 236ab92Copy full SHA for 236ab92
docs/api/options.md
@@ -262,6 +262,25 @@ expect(wrapper.vm.$parent.name).toBe('foo')
262
263
Pass properties for components to use in injection. See [provide/inject](https://vuejs.org/v2/api/#provide-inject).
264
265
+Example:
266
+
267
+```js
268
+const Component = {
269
+ inject: ['foo'],
270
+ template: '<div>{{this.foo()}}</div>'
271
+}
272
273
+const wrapper = shallowMount(Component, {
274
+ provide: {
275
+ foo () {
276
+ return 'fooValue'
277
+ }
278
279
+})
280
281
+expect(wrapper.text()).toBe('fooValue')
282
+```
283
284
## sync
285
286
- type: `boolean`
0 commit comments