Welcome to mirror list, hosted at ThFree Co, Russian Federation.

setup.js « unit « javascript « tests - github.com/nextcloud/tasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 471210718797c31f693cb4f45367183f406814ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import VueTestUtils from '@vue/test-utils'
import { OC } from './OC.js'
import moment from 'moment'
import MockDate from 'mockdate'

// Set date to fixed value
MockDate.set(moment('20190101T123456', 'YYYYMMDDTHHmmss'))

global.OC = new OC()
global.moment = moment

// Mock nextcloud translate functions
VueTestUtils.config.mocks.$t = function(app, string) {
	return string
}
VueTestUtils.config.mocks.t = VueTestUtils.config.mocks.$t
global.t = VueTestUtils.config.mocks.$t

VueTestUtils.config.mocks.$n = function(app, singular, plural, count) {
	return singular
}
VueTestUtils.config.mocks.n = VueTestUtils.config.mocks.$n
global.n = VueTestUtils.config.mocks.$n

global.OCA = {}
global.OCA.Tasks = {}
global.OCA.Tasks.$t = VueTestUtils.config.mocks.$t
global.OCA.Tasks.$n = VueTestUtils.config.mocks.$n

afterAll(() => {
	MockDate.reset()
});