mirror of
https://github.com/koel/koel
synced 2024-12-20 09:33:23 +00:00
42 lines
973 B
TypeScript
42 lines
973 B
TypeScript
|
/// <reference path="./types.d.ts"/>
|
||
|
import '@babel/polyfill'
|
||
|
import Vue from 'vue'
|
||
|
import lodash from 'lodash'
|
||
|
import setupVueTestHelper from 'vue-test-helpers'
|
||
|
import { noop } from './__helpers__'
|
||
|
import { focus, clickaway, droppable } from '@/directives'
|
||
|
|
||
|
// make common utils available globally as well
|
||
|
global.Vue = Vue
|
||
|
global._ = lodash
|
||
|
window.__UNIT_TESTING__ = true
|
||
|
|
||
|
global.noop = noop
|
||
|
|
||
|
// stub this to make Virtual Scroller silent
|
||
|
global.IntersectionObserver = class IntersectionObserver {
|
||
|
observe () {
|
||
|
return null
|
||
|
}
|
||
|
|
||
|
unobserve () {
|
||
|
return null
|
||
|
}
|
||
|
|
||
|
disconnect () {
|
||
|
return null
|
||
|
}
|
||
|
}
|
||
|
|
||
|
global.Vue.directive('koel-focus', focus)
|
||
|
global.Vue.directive('koel-clickaway', clickaway)
|
||
|
global.Vue.directive('koel-droppable', droppable)
|
||
|
|
||
|
setupVueTestHelper({ registerGlobals: false })
|
||
|
|
||
|
/* eslint @typescript-eslint/no-unused-vars: 0 */
|
||
|
// execCommand isn't supported by jsDom (yet?)
|
||
|
document.execCommand = (command: string): boolean => {
|
||
|
return false
|
||
|
}
|