Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update reusability-composition.md #1535

Merged
merged 1 commit into from May 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/guide/advanced/reusability-composition.md
Expand Up @@ -180,7 +180,7 @@ test('provides correct data', () => {

### Testing `inject`

When your Component uses `inject` and you need to pass data with `provide`, then you can use the `global.provides` option.
When your Component uses `inject` and you need to pass data with `provide`, then you can use the `global.provide` option.

```vue
<template>
Expand All @@ -200,7 +200,7 @@ The unit test could simply look like:
test('renders correct data', () => {
const wrapper = mount(MyComponent, {
global: {
provides: {
provide: {
'my-key': 'some-data'
}
}
Expand All @@ -215,4 +215,4 @@ test('renders correct data', () => {
- test simple composables without a component and `@vue/test-utils`
- create a test helper component to test more complex composables
- create a test helper component to test your component provides the correct data with `provide`
- use `global.provides` to pass data to your component which uses `inject`
- use `global.provide` to pass data to your component which uses `inject`