diff --git a/.babelrc b/.babelrc index 7fd52af..84c2e57 100644 --- a/.babelrc +++ b/.babelrc @@ -12,13 +12,5 @@ ] ] } - }, - "plugins": [ - [ - "@babel/plugin-proposal-private-property-in-object", - { - "loose": true - } - ] - ] + } } diff --git a/babel.config.js b/babel.config.js index 9540040..6f92f3d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,6 +1,6 @@ module.exports = { presets: ['@babel/preset-env'], - "plugins": [ + plugins: [ [ "@babel/plugin-proposal-private-property-in-object", { diff --git a/jest.config.ts b/jest.config.ts index 8cc487c..58bfcf1 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -26,12 +26,13 @@ export default { ], collectCoverage: true, collectCoverageFrom: [ - '/nci/components/**/*.{js,vue,ts}', + '/nci/app/components/**/*.{js,vue,ts}', '/nci/storybook/**/*.{js,vue,ts}', '/nci/app/factories/**/*.{js,vue,ts}', '/pages/**/*.{js,vue,ts}', '/store/**/*.{js,vue,ts}', "!**/node_modules/**" ], - testEnvironment: "jsdom" + testEnvironment: "jsdom", + setupFilesAfterEnv: ['./nci/app/testing/registerComponents.ts'] } diff --git a/nci.config.ts b/nci.config.ts index b14fe2e..76d67e0 100644 --- a/nci.config.ts +++ b/nci.config.ts @@ -7,9 +7,8 @@ import Theme from "./nci/theme/default-light"; /** Import App Config Type */ import { AppConfig } from '@/nci/app/interfaces' -const nciConfig = { +export const nciConfig = { config: Config, theme: Theme, } as AppConfig; -export default nciConfig; diff --git a/nci/app/appConfig.ts b/nci/app/appConfig.ts index 76b16ef..4e15cc8 100644 --- a/nci/app/appConfig.ts +++ b/nci/app/appConfig.ts @@ -1,4 +1,4 @@ -import nciConfig from "../../nci.config" +import { nciConfig } from "../../nci.config" /** Import App Config Type */ import { AppConfig } from '@/nci/app/interfaces' diff --git a/nci/components/nci-anchor/__test__/index.test.ts b/nci/app/components/nci-anchor/__test__/index.test.ts similarity index 94% rename from nci/components/nci-anchor/__test__/index.test.ts rename to nci/app/components/nci-anchor/__test__/index.test.ts index d358df4..c87184f 100644 --- a/nci/components/nci-anchor/__test__/index.test.ts +++ b/nci/app/components/nci-anchor/__test__/index.test.ts @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils' -import nciAnchor from '@/nci/components/nci-anchor/index.vue' +import nciAnchor from '@/nci/app/components/nci-anchor/index.vue' import { Button } from '@/nci/app/interfaces'; /** Button Component Tests */ @@ -22,7 +22,6 @@ describe('nci-anchor component', () => { } as Button, stubs: ['nuxt-link'] }) - /** Check the component mounted */ expect(wrapper.vm).toBeTruthy(); diff --git a/nci/components/nci-anchor/index.vue b/nci/app/components/nci-anchor/index.vue similarity index 100% rename from nci/components/nci-anchor/index.vue rename to nci/app/components/nci-anchor/index.vue diff --git a/nci/components/nci-anchor/stories/button/__test__/index.test.ts b/nci/app/components/nci-anchor/stories/button/__test__/index.test.ts similarity index 66% rename from nci/components/nci-anchor/stories/button/__test__/index.test.ts rename to nci/app/components/nci-anchor/stories/button/__test__/index.test.ts index c991b49..82c7ddf 100644 --- a/nci/components/nci-anchor/stories/button/__test__/index.test.ts +++ b/nci/app/components/nci-anchor/stories/button/__test__/index.test.ts @@ -2,15 +2,16 @@ import { mount } from '@vue/test-utils'; -import nciAnchor from '@/nci/components/nci-anchor/index.vue'; +import nciAnchor from '@/nci/app/components/nci-anchor/index.vue'; //👇 Imports a specific story for the test -import { button } from '@/nci/components/nci-anchor/stories/button/index.stories'; +import { button } from '@/nci/app/components/nci-anchor/stories/button/index.stories'; it('renders the button in the primary state', () => { const wrapper = mount(nciAnchor, { propsData: button.args, stubs: ['nuxt-link'] }); + expect(wrapper).toBeTruthy(); }); diff --git a/nci/components/nci-anchor/stories/button/index.stories.ts b/nci/app/components/nci-anchor/stories/button/index.stories.ts similarity index 89% rename from nci/components/nci-anchor/stories/button/index.stories.ts rename to nci/app/components/nci-anchor/stories/button/index.stories.ts index 0313a92..fea79cd 100644 --- a/nci/components/nci-anchor/stories/button/index.stories.ts +++ b/nci/app/components/nci-anchor/stories/button/index.stories.ts @@ -1,5 +1,5 @@ /** Import the Nuxt Image component */ -import nciAnchor from '@/nci/components/nci-anchor/index.vue'; +import nciAnchor from '@/nci/app/components/nci-anchor/index.vue'; /** Import shared Typeface interfaces */ import { Button } from '@/nci/app/interfaces'; @@ -47,5 +47,4 @@ const datab = { export const button: Story