Skip to content

Npm installation error (VueJS/Typescript) #60

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

Closed
kangelSL opened this issue Jul 18, 2019 · 2 comments
Closed

Npm installation error (VueJS/Typescript) #60

kangelSL opened this issue Jul 18, 2019 · 2 comments
Labels
has PR There's an open PR to solve/close the issue help wanted Extra attention is needed

Comments

@kangelSL
Copy link

Bug:

On a VueJS project, using the npm install command and basic import statement ( import { render, fireEvent, cleanup } from '@testing-library/vue']) raises an error:

  • Could not find a declaration file '@testing-library/vue'

The error recommends installing @types/testing-library__vue. But attempting to install this provides another error message:

  • @types/testing-library__vue@latest is not in the npm registry.

To reproduce:

  • Spin up a vue app with Jest as the default testing provider and use typescript
  • Open a .spec.ts file
  • Run the npm install for vue testing library
  • Add import { render, fireEvent, cleanup } from '@testing-library/vue';
  • IDE picks out import library as an error, npm run test will no longer run successfully
  • Installing the suggested library @types/testing-library__vue --save-dev is unsuccessful

Related information:

  • @testing-library/vue version: ^1.1.0
  • Vue version: ^2.6.10
  • node version: 10.15.3
  • npm version: 6.9.0

Related code/config:

  • Using typescript
@kangelSL kangelSL added the bug Something isn't working label Jul 18, 2019
@afontcu
Copy link
Member

afontcu commented Jul 18, 2019

Hi! Vue Testing Library isn't providing types, so that's why you're getting the error (AFAIK).

I don't have much experience with TS, so I'd be really grateful if someone stepped in and helped us provide types for Vue Testing Library :)

@afontcu afontcu added help wanted Extra attention is needed and removed bug Something isn't working labels Jul 18, 2019
cimbul added a commit to cimbul/vue-testing-library that referenced this issue Aug 9, 2019
Followed recommendations in [dtslint tool](https://github.com/microsoft/dtslint) and [TypeScript documentation](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html).

Took tsconfig.json and tslint.json from @testing-library/dom, although it looks like they just copied the examples in the dtslint docs.

Closes testing-library#60.
@cimbul cimbul mentioned this issue Aug 9, 2019
@afontcu afontcu added the has PR There's an open PR to solve/close the issue label Aug 10, 2019
@afontcu
Copy link
Member

afontcu commented Sep 3, 2019

I'm closing this since VTL is now providing types :)

@afontcu afontcu closed this as completed Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has PR There's an open PR to solve/close the issue help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants