Skip to content

Commit

Permalink
chore: add return type to createStub
Browse files Browse the repository at this point in the history
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 vuejs#1543
  • Loading branch information
cexbrayat committed May 27, 2022
1 parent 3e60ccc commit 22ea775
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
VNodeTypes,
ConcreteComponent,
ComponentPropsOptions,
ComponentObjectPropsOptions
ComponentObjectPropsOptions,
DefineComponent
} from 'vue'
import { hyphenate } from './utils/vueShared'
import { matchName } from './utils/matchName'
Expand Down Expand Up @@ -78,7 +79,7 @@ export const createStub = ({
name,
type,
renderStubDefaultSlot
}: StubOptions) => {
}: StubOptions): DefineComponent => {
const anonName = 'anonymous-stub'
const tag = name ? `${hyphenate(name)}-stub` : anonName

Expand Down

0 comments on commit 22ea775

Please sign in to comment.