Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pikax committed May 19, 2022
1 parent 8f9a91d commit 9a48c64
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/baseWrapper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { textContent } from './utils'
import type { TriggerOptions } from './createDomEvent'
import {
Component,
ComponentInternalInstance,
ComponentPublicInstance,
FunctionalComponent,
Expand Down Expand Up @@ -115,6 +116,9 @@ export default abstract class BaseWrapper<ElementType extends Node>
findComponent<T extends ComponentPublicInstance>(
selector: T | FindComponentSelector
): VueWrapper<T>
// Find my CatchAll component
findComponent<T extends Component>(selector: T): DOMWrapper<Node>
findComponent<T extends Component>(selector: string): DOMWrapper<Element>
// catch all declaration
findComponent<T extends never>(selector: FindComponentSelector): WrapperLike

Expand Down
3 changes: 2 additions & 1 deletion tests/features/compat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { mount } from '../../src'

jest.mock('vue', () => mockVue)

const { configureCompat, extend, defineComponent, h } = mockVue as any

const { configureCompat, extend, defineComponent, h } = mockVue

describe('@vue/compat build', () => {
describe.each(['suppress-warning', false])(
Expand Down
4 changes: 2 additions & 2 deletions tests/mountingOptions/mocks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ describe('mocks', () => {
</div>
`,
computed: {
url() {
url(): string {
return `/posts/${this.$route.params.id}`
},
id() {
id(): string | string[] {
return this.$route.params.id
}
},
Expand Down
5 changes: 5 additions & 0 deletions types/compat.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
declare module '@vue/compat' {
export * from 'vue'
export function extend<T>(options: T): T

export function configureCompat(
option: Record<string, boolean | string | number>
): void
}

0 comments on commit 9a48c64

Please sign in to comment.