Skip to content

Commit 22ea775

Browse files
committed
chore: add return type to createStub
Fixes the error: ``` src/index.ts → dist/vue-test-utils.esm-bundler.mjs... [!] (plugin commonjs--resolver) Error: /home/runner/work/test-utils/test-utils/src/stubs.ts(77,14): semantic error TS2742: The inferred type of 'createStub' cannot be named without a reference to '@vue/compiler-dom/node_modules/@vue/shared'. This is likely not portable. A type annotation is necessary. ``` that we see when upgrading the lockfile in #1543
1 parent 3e60ccc commit 22ea775

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/stubs.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {
99
VNodeTypes,
1010
ConcreteComponent,
1111
ComponentPropsOptions,
12-
ComponentObjectPropsOptions
12+
ComponentObjectPropsOptions,
13+
DefineComponent
1314
} from 'vue'
1415
import { hyphenate } from './utils/vueShared'
1516
import { matchName } from './utils/matchName'
@@ -78,7 +79,7 @@ export const createStub = ({
7879
name,
7980
type,
8081
renderStubDefaultSlot
81-
}: StubOptions) => {
82+
}: StubOptions): DefineComponent => {
8283
const anonName = 'anonymous-stub'
8384
const tag = name ? `${hyphenate(name)}-stub` : anonName
8485

0 commit comments

Comments
 (0)