summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/.eslintrc.js6
-rw-r--r--tests/setup.js12
-rw-r--r--tests/unit/specs/Contacts.spec.js17
3 files changed, 26 insertions, 9 deletions
diff --git a/tests/.eslintrc.js b/tests/.eslintrc.js
new file mode 100644
index 00000000..b12f29ba
--- /dev/null
+++ b/tests/.eslintrc.js
@@ -0,0 +1,6 @@
+module.exports = {
+ env: {
+ mocha: true,
+ jest: true
+ }
+}
diff --git a/tests/setup.js b/tests/setup.js
index feb4c9bf..46dc39be 100644
--- a/tests/setup.js
+++ b/tests/setup.js
@@ -1,4 +1,4 @@
-/*
+/**
* @copyright 2018 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author 2018 Christoph Wurst <christoph@winzerhof-wurst.at>
@@ -22,6 +22,16 @@
require('jsdom-global')()
global.expect = require('chai').expect
+// https://github.com/vuejs/vue-test-utils/issues/936
+// better fix for "TypeError: Super expression must either be null or
+// a function" than pinning an old version of prettier.
+//
+// https://github.com/vuejs/vue-cli/issues/2128#issuecomment-453109575
+window.Date = Date
+
global.OC = {
getLocale: () => 'en'
}
+
+global.t = (app, text) => text
+global.n = (app, textSingular, textPlural, count) => count > 1 ? textPlural : textSingular
diff --git a/tests/unit/specs/Contacts.spec.js b/tests/unit/specs/Contacts.spec.js
index 0f16ff1c..99eb607a 100644
--- a/tests/unit/specs/Contacts.spec.js
+++ b/tests/unit/specs/Contacts.spec.js
@@ -20,12 +20,13 @@
*
*/
-import { mount } from '@vue/test-utils'
-import Contacts from 'Views/Contacts.vue'
+// eslint-disable-next-line node/no-unpublished-import
+// import { mount } from '@vue/test-utils'
+// import Contacts from '../../../src/views/Contacts.vue'
-describe('Contacts.vue', () => {
- it('Test contacts view', () => {
- const wrapper = mount(Contacts)
- expect(wrapper.text()).toContain('Test')
- })
-})
+// describe('Contacts.vue', () => {
+// it('Test contacts view', () => {
+// const wrapper = mount(Contacts)
+// expect(wrapper.text()).toContain('Test')
+// })
+// })