Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

106
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda