Skip to content

Commit 2d98e8c

Browse files
committed
fix(vue): type FlareErrorBoundary $router mock for active vue-router augmentation
1 parent fdac544 commit 2d98e8c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

packages/vue/tests/FlareErrorBoundary.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Attributes } from '@flareapp/js';
22
import { mount } from '@vue/test-utils';
33
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
44
import { defineComponent, h, nextTick } from 'vue';
5+
import type { ComponentCustomProperties } from 'vue';
56

67
import { FlareErrorBoundary } from '../src/FlareErrorBoundary';
78
import { ComponentHierarchyFrame, FlareVueContext } from '../src/types';
@@ -971,9 +972,12 @@ describe('FlareErrorBoundary', () => {
971972
mount(FlareErrorBoundary, {
972973
global: {
973974
config: {
975+
// vue-router's `declare module 'vue'` augmentation (pulled into this package's
976+
// tsc program by the router-tracing tests) types globalProperties as the full
977+
// ComponentCustomProperties; the boundary only reads $router.currentRoute.value.
974978
globalProperties: {
975979
$router: mockRouter(mockRoute),
976-
},
980+
} as unknown as ComponentCustomProperties,
977981
},
978982
},
979983
slots: {
@@ -1016,9 +1020,12 @@ describe('FlareErrorBoundary', () => {
10161020
mount(FlareErrorBoundary, {
10171021
global: {
10181022
config: {
1023+
// vue-router's `declare module 'vue'` augmentation (pulled into this package's
1024+
// tsc program by the router-tracing tests) types globalProperties as the full
1025+
// ComponentCustomProperties; the boundary only reads $router.currentRoute.value.
10191026
globalProperties: {
10201027
$router: mockRouter(mockRoute),
1021-
},
1028+
} as unknown as ComponentCustomProperties,
10221029
},
10231030
},
10241031
props: { beforeSubmit },

0 commit comments

Comments
 (0)