-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue 3 upgrade #551
base: master
Are you sure you want to change the base?
Vue 3 upgrade #551
Changes from all commits
fa0574e
f618827
bc66ddd
ec8a00c
1db2c77
b33d8e2
fbff5b1
214c02b
a2f24fa
7c013d8
25b68ae
b755f05
53ffa55
94b56c2
9446e4d
53e1737
a2970a3
f780403
f277e3a
3c8acda
265103a
4f45e37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:12 | ||
FROM node:19 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a huge jump :D |
||
|
||
EXPOSE 8080 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
presets: ['@vue/app'] | ||
presets: ['@vue/app'], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,159 @@ | ||
import { mount as nativeMount, createLocalVue } from '@vue/test-utils'; | ||
import Vuetify from 'vuetify'; | ||
import { mount as nativeMount } from '@vue/test-utils'; | ||
import { vi } from 'vitest'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do I understand correctly that we are nesting Vitest in Jest? If that's correct (just to get up to speed) why we are doing this? Again - if the answer demands too much let's skip it. I'm just fishing if there's something that should be added in the docs to explain how it works. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are not nesting it, but unfortunately we are using both jest and vitest for now. At some point we need to reconfigure eslint to use vitest, and move all subpackages that are dependent on jest to something different (and most likely reconfigure that too). |
||
import { createVuetify } from 'vuetify'; | ||
import { createStore } from 'vuex'; | ||
import Vuex from 'vuex'; | ||
import * as components from 'vuetify/components'; | ||
import * as directives from 'vuetify/directives'; | ||
import HacknightWrapper from '../src/components/Dashboard/Hacknight/HacknightWrapper.vue'; | ||
import HacknightsParticipants from '../src/components/Dashboard/HacknightsParticipants/HacknightsParticipants.vue'; | ||
import DashboardHeader from '../src/components/Dashboard/Header/DashboardHeader.vue'; | ||
import ParticipantsSearch from '../src/components/Dashboard/Participants/ParticipantsSearch/ParticipantsSearch.vue'; | ||
import ParticipantsList from '../src/components/Dashboard/Participants/ParticipantsList.vue'; | ||
import ParticipantsChart from '../src/components/Dashboard/ParticipantsChart/ParticipantsChart.vue'; | ||
import DashboardMain from '../src/components/Dashboard/DashboardMain.vue'; | ||
import AboutUs from '../src/components/HomePage/AboutUs/AboutUs.vue'; | ||
import ContactUs from '../src/components/HomePage/ContactUs/ContactUs.vue'; | ||
import HomePageHeader from '../src/components/HomePage/Header/HomePageHeader.vue'; | ||
import JoinUs from '../src/components/HomePage/JoinUs/JoinUs.vue'; | ||
import OurProjects from '../src/components/HomePage/OurProjects/OurProjects.vue'; | ||
import ModalContent from '../src/components/HomePage/OurProjects/ModalContent/ModalContent.vue'; | ||
import PageFooter from '../src/components/HomePage/PageFooter/PageFooter.vue'; | ||
import SocialMedia from '../src/components/HomePage/SocialMedia/SocialMedia.vue'; | ||
import HomePage from '../src/components/HomePage/HomePage.vue'; | ||
import LoginForm from '../src/components/Login/LoginForm.vue'; | ||
|
||
const storeObject = { | ||
modules: { | ||
hacknight: { | ||
namespaced: true, | ||
getters: { | ||
getHacknights: jest.fn(() => []), | ||
getHacknight: jest.fn(() => ({ participants: [] })), | ||
getError: jest.fn() | ||
getHacknights: vi.fn(() => []), | ||
getHacknight: vi.fn(() => ({ participants: [] })), | ||
getError: vi.fn(), | ||
}, | ||
actions: { getHacknights: jest.fn() } | ||
actions: { getHacknights: vi.fn() }, | ||
}, | ||
participant: { | ||
namespaced: true, | ||
getters: { getParticipants: jest.fn(() => []), getError: jest.fn() }, | ||
actions: { getParticipants: jest.fn() } | ||
getters: { getParticipants: vi.fn(() => []), getError: vi.fn() }, | ||
actions: { getParticipants: vi.fn() }, | ||
}, | ||
auth: { | ||
namespaced: true, | ||
getters: { getError: jest.fn() } | ||
getters: { getError: vi.fn() }, | ||
}, | ||
contact: { | ||
namespaced: true, | ||
getters: { successfullySent: jest.fn(), msgErrorRaised: jest.fn() } | ||
} | ||
} | ||
getters: { successfullySent: vi.fn(), msgErrorRaised: vi.fn() }, | ||
}, | ||
}, | ||
}; | ||
|
||
// mount function from @vue/test-utils | ||
// needs this enhancement to render vuetify components correctly | ||
// source: https://vuetifyjs.com/en/getting-started/unit-testing/#mocking-vuetify | ||
|
||
export const getMountWithVuetify = () => { | ||
const localVue = createLocalVue(); | ||
const vuetify = new Vuetify(); | ||
const vuetify = createVuetify({ | ||
components, | ||
directives, | ||
}); | ||
|
||
return Component => { | ||
return nativeMount(Component, { localVue, vuetify }); | ||
}; | ||
return nativeMount({ | ||
props: {}, | ||
global: { | ||
components: { | ||
HacknightWrapper, | ||
HacknightsParticipants, | ||
DashboardHeader, | ||
ParticipantsSearch, | ||
ParticipantsList, | ||
ParticipantsChart, | ||
DashboardMain, | ||
AboutUs, | ||
ContactUs, | ||
HomePageHeader, | ||
JoinUs, | ||
OurProjects, | ||
ModalContent, | ||
PageFooter, | ||
SocialMedia, | ||
HomePage, | ||
LoginForm, | ||
}, | ||
plugins: [vuetify], | ||
}, | ||
}); | ||
}; | ||
|
||
// mount function from @vue/test-utils | ||
// needs this enhancement to render components using vuex correctly | ||
// source: https://vue-test-utils.vuejs.org/guides/using-with-vuex.html | ||
|
||
export const getMountWithVuex = () => { | ||
const localVue = createLocalVue(); | ||
localVue.use(Vuex); | ||
const store = createStore(storeObject); | ||
|
||
return Component => { | ||
const store = new Vuex.Store(storeObject); | ||
|
||
return nativeMount(Component, { store, localVue, stubs: ['apexchart'] }); | ||
}; | ||
return nativeMount({ | ||
props: {}, | ||
global: { | ||
components: { | ||
HacknightWrapper, | ||
HacknightsParticipants, | ||
DashboardHeader, | ||
ParticipantsSearch, | ||
ParticipantsList, | ||
ParticipantsChart, | ||
DashboardMain, | ||
AboutUs, | ||
ContactUs, | ||
HomePageHeader, | ||
JoinUs, | ||
OurProjects, | ||
ModalContent, | ||
PageFooter, | ||
SocialMedia, | ||
HomePage, | ||
LoginForm, | ||
}, | ||
plugins: [store], | ||
}, | ||
}); | ||
}; | ||
|
||
// Use this function if you need to test a component | ||
// that uses both Vuex and Vuetify | ||
|
||
export const getMountWithProviders = () => { | ||
const localVue = createLocalVue(); | ||
localVue.use(Vuex); | ||
const vuetify = new Vuetify(); | ||
|
||
return Component => { | ||
const store = new Vuex.Store(storeObject); | ||
const store = createStore(storeObject); | ||
const vuetify = createVuetify({ | ||
components, | ||
directives, | ||
}); | ||
|
||
return nativeMount(Component, { | ||
store, | ||
localVue, | ||
vuetify, | ||
stubs: ['apexchart'] | ||
}); | ||
}; | ||
return nativeMount({ | ||
props: {}, | ||
global: { | ||
components: { | ||
HacknightWrapper, | ||
HacknightsParticipants, | ||
DashboardHeader, | ||
ParticipantsSearch, | ||
ParticipantsList, | ||
ParticipantsChart, | ||
DashboardMain, | ||
AboutUs, | ||
ContactUs, | ||
HomePageHeader, | ||
JoinUs, | ||
OurProjects, | ||
ModalContent, | ||
PageFooter, | ||
SocialMedia, | ||
HomePage, | ||
LoginForm, | ||
}, | ||
plugins: [store, vuetify], | ||
}, | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a workaround? Not sure how it works exactly but it seems that
true
is made to ignore this rule [docs here].There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the documentation you linked, the value
Defaults to true
It means that there is no change in the logic. I don't remember adding that flag manually (although it is very possible that I forgot that I did it :) ) It is possible that it was added automatically when updating some package.