Skip to content

Commit

Permalink
fix(types): Pass Store type to RenderOptions/render function (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
esyw committed May 9, 2022
1 parent 4316bd3 commit 181765f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ type Routes = any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Router = any

export interface RenderOptions<V extends Vue>
export interface RenderOptions<V extends Vue, S = Store>
// The props and store options special-cased by Vue Testing Library and NOT passed to mount().
extends Omit<ThisTypedMountOptions<V>, 'store' | 'props'> {
props?: object
store?: Store
store?: S
routes?: Routes
container?: Element
baseElement?: Element
Expand All @@ -61,9 +61,11 @@ export type ConfigurationCallback<V extends Vue> =
// eslint-disable-next-line @typescript-eslint/no-explicit-any
| ((localVue: typeof Vue, store: Store, router: Router) => void)

export function render<V extends Vue>(
export function render<V extends Vue, S = Store>(
TestComponent: VueClass<V> | ComponentOptions<V>,
options?: RenderOptions<V>,
// eslint-disable-next-line @typescript-eslint/ban-tslint-comment
// tslint:disable-next-line no-unnecessary-generics
options?: RenderOptions<V, S>,
configure?: ConfigurationCallback<V>,
): RenderResult

Expand Down

0 comments on commit 181765f

Please sign in to comment.