How to use the @vue/test-utils.config function in @vue/test-utils

To help you get started, we’ve selected a few @vue/test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tianyong90 / we-vue / test / unit / index.js View on Github external
import Vue from 'vue'
import expect from 'expect'
import VueTestUtils from '@vue/test-utils'

Vue.config.productionTip = false

// IMPORTANT: DO NOT use vue-test-utils transitionStub
VueTestUtils.config.stubs.transition = false

global.expect = expect

// require all test files (files that ends with .spec.js)
const testsContext = require.context('./specs', true, /\.spec$/)
testsContext.keys().forEach(testsContext)

// require all src files except main.js for coverage.
// you can also change this to match only the subset of files that
// you want coverage for.
const srcContext = require.context('../../src', true, /^\.\/(?!index(\.js)?$)/)
srcContext.keys().forEach(srcContext)
github ArkEcosystem / desktop-wallet / __tests__ / unit / __utils__ / setup.js View on Github external
// This Intl polyfill has some problems with number precision, so we store the original
// implementation to use it instead when that lack of accuracy is an issue
global.__Intl__ = global.Intl
global.Intl = require('intl')

HTMLCanvasElement.prototype.getContext = jest.fn()

Vue.use(VTooltip, {
  defaultHtml: false,
  defaultContainer: '#app'
})
Vue.use(directives)
Vue.use(filters)
Vue.config.ignoredElements = ['webview']

VueTestUtils.config.mocks.$eventBus = eventBus
VueTestUtils.config.mocks.$client = {
  fetchDelegates: jest.fn()
}

VueTestUtils.config.mocks.assets_loadImage = jest.fn()
VueTestUtils.config.mocks.collections_filterChildren = jest.fn()
VueTestUtils.config.mocks.currency_format = jest.fn()
VueTestUtils.config.mocks.currency_subToUnit = jest.fn()
VueTestUtils.config.mocks.electron_openExternal = jest.fn()
VueTestUtils.config.mocks.session_network = jest.fn()
VueTestUtils.config.mocks.session_profile = jest.fn()
VueTestUtils.config.mocks.wallet_fromRoute = {}
github ArkEcosystem / desktop-wallet / __tests__ / unit / __utils__ / setup.js View on Github external
Vue.use(VTooltip, {
  defaultHtml: false,
  defaultContainer: '#app'
})
Vue.use(directives)
Vue.use(filters)
Vue.config.ignoredElements = ['webview']

VueTestUtils.config.mocks.$eventBus = eventBus
VueTestUtils.config.mocks.$client = {
  fetchDelegates: jest.fn()
}

VueTestUtils.config.mocks.assets_loadImage = jest.fn()
VueTestUtils.config.mocks.collections_filterChildren = jest.fn()
VueTestUtils.config.mocks.currency_format = jest.fn()
VueTestUtils.config.mocks.currency_subToUnit = jest.fn()
VueTestUtils.config.mocks.electron_openExternal = jest.fn()
VueTestUtils.config.mocks.session_network = jest.fn()
VueTestUtils.config.mocks.session_profile = jest.fn()
VueTestUtils.config.mocks.wallet_fromRoute = {}
github PECE-project / drupal-pece / src / front / jest.init.js View on Github external
import Vue from 'vue'

import VueCompositionApi from '@vue/composition-api'
import VueTestUtils from '@vue/test-utils'

import translations from './lang/en-US'

Vue.use(VueCompositionApi)
VueTestUtils.config.mocks.$t = msg => translations[msg]