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

feat: add teleport stub possibility, https://github.com/vuejs/test-ut… #2336

Merged
merged 2 commits into from Feb 12, 2024
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions docs/fr/guide/advanced/teleport.md
Expand Up @@ -188,6 +188,20 @@ test('teleport', async () => {
});
```

Vous pouvez remplacer teleport par un stub en utilisant `teleport: true`:
```ts
import { mount } from '@vue/test-utils'
import Navbar from './Navbar.vue'

test('teleport', async () => {
const wrapper = mount(Navbar, {
stubs: {
teleport: true
}
})
})
```

## Conclusion

- Créez une cible de téléportation avec `document.createElement`.
Expand Down
15 changes: 15 additions & 0 deletions docs/guide/advanced/teleport.md
Expand Up @@ -187,6 +187,21 @@ test('teleport', async () => {
})
```

You can stub teleport by using `teleport: true`:

```ts
import { mount } from '@vue/test-utils'
import Navbar from './Navbar.vue'

test('teleport', async () => {
const wrapper = mount(Navbar, {
stubs: {
teleport: true
}
})
})
```

## Conclusion

- Create a teleport target with `document.createElement`.
Expand Down