diff --git a/.gitignore b/.gitignore index f76f715..a959407 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ node_modules package-lock.json /*/yarn.lock yarn.lock +coverage # local env files .env.local diff --git a/client/jest.config.js b/client/jest.config.js index 8b359f8..2f6a4fb 100644 --- a/client/jest.config.js +++ b/client/jest.config.js @@ -1,3 +1,4 @@ module.exports = { - preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel' -} + preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel', + collectCoverageFrom: ['/use/*.js'] +}; diff --git a/client/src/tests/unit/TheFooter.spec.js b/client/src/tests/unit/TheFooter.spec.js index b64a720..19059fa 100644 --- a/client/src/tests/unit/TheFooter.spec.js +++ b/client/src/tests/unit/TheFooter.spec.js @@ -1,22 +1,23 @@ -// import { shallowMount, createLocalVue } from '@vue/test-utils'; -// import Vuetify from 'vuetify'; -// import Vue from 'vue'; -// import TheFooter from '@/components/TheFooter'; +// An exapmle of working component unit-test +import { shallowMount, createLocalVue } from '@vue/test-utils'; +import Vuetify from 'vuetify'; +import Vue from 'vue'; +import TheFooter from '@/components/TheFooter'; -// Vue.use(Vuetify); +Vue.use(Vuetify); -// const localVue = createLocalVue(); -// localVue.use(Vuetify); +const localVue = createLocalVue(); +localVue.use(Vuetify); -// describe('Components: TheFooter', () => { -// let wrapper = null; -// beforeEach(() => { -// wrapper = shallowMount(TheFooter, { -// localVue -// }); -// }); +describe('Components: TheFooter', () => { + let wrapper = null; + beforeEach(() => { + wrapper = shallowMount(TheFooter, { + localVue + }); + }); -// it('it should render copy footer', () => { -// expect(wrapper.find('[data-test-copy]').text()).toBe('©'); -// }); -// }); + it('it should render copy footer', () => { + expect(wrapper.find('[data-test-copy]').text()).toBe('©'); + }); +});