Skip to content

Commit

Permalink
Use alias for jest file resolution
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Feb 2, 2020
1 parent ecd7a48 commit a5322e7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
10 changes: 9 additions & 1 deletion package.json
Expand Up @@ -104,7 +104,15 @@
"vue"
],
"moduleNameMapper": {
"^@/(.*)$": "<rootDir>/src/$1"
"^@/(.*)$": "<rootDir>/src/$1",
"^Assets/(.*)$": "<rootDir>/src/assets/$1",
"^Components/(.*)$": "<rootDir>/src/components/$1",
"^Directives/(.*)$": "<rootDir>/src/directives/$1",
"^Fonts/(.*)$": "<rootDir>/src/fonts/$1",
"^Mixins/(.*)$": "<rootDir>/src/mixins/$1",
"^Models/(.*)$": "<rootDir>/src/models/$1",
"^Store/(.*)$": "<rootDir>/src/store/$1",
"^Utils/(.*)$": "<rootDir>/src/utils/$1"
},
"testEnvironment": "jest-environment-jsdom-sixteen",
"transform": {
Expand Down
@@ -1,6 +1,6 @@
import { mount } from '@vue/test-utils'
import General from '../../../../../src/components/TheCollections/General'
import router from '../../../../../src/router'
import General from 'Components/TheCollections/General'
import router from '@/router'

import { store, localVue } from '../../setupStore'

Expand Down
4 changes: 2 additions & 2 deletions tests/javascript/unit/components/TheCollections/Week.spec.js
@@ -1,6 +1,6 @@
import { mount } from '@vue/test-utils'
import Week from '../../../../../src/components/TheCollections/Week'
import router from '../../../../../src/router'
import Week from 'Components/TheCollections/Week'
import router from '@/router'

import { store, localVue } from '../../setupStore'

Expand Down
2 changes: 1 addition & 1 deletion tests/javascript/unit/models/task.spec.js
@@ -1,4 +1,4 @@
import Task from '../../../../src/models/task'
import Task from 'Models/task'

describe('task', () => {
'use strict'
Expand Down
10 changes: 5 additions & 5 deletions tests/javascript/unit/setupStore.js
@@ -1,11 +1,11 @@
import { createLocalVue } from '@vue/test-utils'
import Vuex from 'vuex'

import calendars, { mapDavCollectionToCalendar } from '../../../src/store/calendars'
import collections from '../../../src/store/collections'
import tasks from '../../../src/store/tasks'
import settings from '../../../src/store/settings'
import Task from '../../../src/models/task'
import calendars, { mapDavCollectionToCalendar } from 'Store/calendars'
import collections from 'Store/collections'
import tasks from 'Store/tasks'
import settings from 'Store/settings'
import Task from 'Models/task'

const localVue = createLocalVue()
localVue.use(Vuex)
Expand Down
4 changes: 2 additions & 2 deletions tests/javascript/unit/store/storeHelper.spec.js
@@ -1,5 +1,5 @@
import { sort } from '../../../../src/store/storeHelper'
import Task from '../../../../src/models/task'
import { sort } from 'Store/storeHelper'
import Task from 'Models/task'

const vCalendars = [`
BEGIN:VCALENDAR\n
Expand Down

0 comments on commit a5322e7

Please sign in to comment.