Skip to content
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

Typescript definition for stubs doesnn't allow false #1330

Closed
Robjam opened this issue Oct 25, 2019 · 2 comments
Closed

Typescript definition for stubs doesnn't allow false #1330

Robjam opened this issue Oct 25, 2019 · 2 comments

Comments

@Robjam
Copy link

Robjam commented Oct 25, 2019

Version

1.0.0-beta.29

Reproduction link

https://github.com/Robjam/vue-test-utils-typescript-example/tree/repro/stub-false-typescript

Steps to reproduce

vue create with unit tests and typescript
in helloworld.spec.ts shallowmount add:

    const wrapper = shallowMount(HelloWorld, {
      stubs: {
        transition: false
      }
    });

shallowMount encounters a type error as Stubs type (https://github.com/vuejs/vue-test-utils/blob/v1.0.0-beta.29/packages/test-utils/types/index.d.ts#L30) does not allow false.

What is expected?

that boolean is an acceptable type.

What is actually happening?

Typescript fails to compile.


It appears this is addressed in commit, but not yet released.

Workaround is to add // @ts-ignore to line before shallowMount foregoing all type checks on mount.

@dobromir-hristov
Copy link
Contributor

Should be merged in beta.30. please verify.

@dobromir-hristov
Copy link
Contributor

Yep it's in the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants