Skip to content

fix(types): Pass Store type to RenderOptions/render function #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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