(
component: T,
options: ComponentMountingOptions<T> = {},
overrides: {
initialPiniaState?: StateTree;
plugins?: {
pinia?: Plugin;
};
} = {},
)
| 32 | }; |
| 33 | |
| 34 | export const mount = <T extends Component>( |
| 35 | component: T, |
| 36 | options: ComponentMountingOptions<T> = {}, |
| 37 | overrides: { |
| 38 | initialPiniaState?: StateTree; |
| 39 | plugins?: { |
| 40 | pinia?: Plugin; |
| 41 | }; |
| 42 | } = {}, |
| 43 | ) => { |
| 44 | const mocks = options.global?.mocks || {}; |
| 45 | const plugins = options.global?.plugins || []; |
| 46 | |
| 47 | return componentMount(component, { |
| 48 | ...options, |
| 49 | global: { |
| 50 | ...options.global, |
| 51 | plugins: [ |
| 52 | overrides.plugins?.pinia ?? |
| 53 | createTestingPinia({ initialState: overrides.initialPiniaState }), |
| 54 | vuetify(), |
| 55 | i18n, |
| 56 | serviceManager, |
| 57 | navigation.withSections({ main: [] }), |
| 58 | mockRouter, |
| 59 | ...plugins, |
| 60 | ], |
| 61 | mocks: { |
| 62 | ...mocks, |
| 63 | }, |
| 64 | }, |
| 65 | }); |
| 66 | }; |
| 67 | |
| 68 | export const setupComponent = <Props, RawBindings>( |
| 69 | setupFunction: () => RawBindings, |
no test coverage detected