[Vuejs]-Cypress component testing with Vue-I18N

-1👍

Cypress.Commands.add('mount', (component, options = {}) => {
  // Setup options object
  options.global = options.global || {}
  options.global.stubs = options.global.stubs || {}
  options.global.stubs.transition = false
  options.global.components = options.global.components || {}
  options.global.plugins = options.global.plugins || []

  // Use store passed in from options, or initialize a new one
  const {/* store = getStore(), */ ...mountOptions} = options

  // Add plugins here
  options.global.plugins.push({
    install(app) {
      app.use(i18n)
    },
  })

  return mount(component, mountOptions)
})
👤Orbis

Leave a comment