Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

104
Vistas
Register global custom directive for cypress component testing in vue

Is there way register global custom directive for cypress component testing in vue. Just register with

app.directive('some',(el,binding)=>{{...})

in main.js file can't solve problem. Because in the component testing component failed resolve that directive.

Local register like that:

mount(SomeComp,{
directive:{
  'some': {...}
})

isn't good option. Because i use this directive in every component and need local register in every component.

How i can register global directive for cypress component testing ?

Thanxx

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Create your own mount,

import { mount } from '@cypress/vue'

export const mountWithDirective = (myComponent) => {

  return mount(myComponent, {
    directive:{
      'some': {...}
  })
}

Put it in /cypress/support/index.js or another file of your choosing.

// test
import { mountWithDirective } from 'cypress/support'
import Component from './Component.vue'

it...
  mountWithDirective(Component)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda