File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,20 @@ test('teleport', async () => {
188188});
189189```
190190
191+ Vous pouvez remplacer teleport par un stub en utilisant ` teleport: true ` :
192+ ``` ts
193+ import { mount } from ' @vue/test-utils'
194+ import Navbar from ' ./Navbar.vue'
195+
196+ test (' teleport' , async () => {
197+ const wrapper = mount (Navbar , {
198+ stubs: {
199+ teleport: true
200+ }
201+ })
202+ })
203+ ```
204+
191205## Conclusion
192206
193207- Créez une cible de téléportation avec ` document.createElement ` .
Original file line number Diff line number Diff line change @@ -187,6 +187,21 @@ test('teleport', async () => {
187187})
188188```
189189
190+ You can stub teleport by using ` teleport: true ` :
191+
192+ ``` ts
193+ import { mount } from ' @vue/test-utils'
194+ import Navbar from ' ./Navbar.vue'
195+
196+ test (' teleport' , async () => {
197+ const wrapper = mount (Navbar , {
198+ stubs: {
199+ teleport: true
200+ }
201+ })
202+ })
203+ ```
204+
190205## Conclusion
191206
192207- Create a teleport target with ` document.createElement ` .
You can’t perform that action at this time.
0 commit comments