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

Add types to package.json #135

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0-semantically-released",
"description": "Custom jest matchers to test the state of the DOM",
"main": "dist/index.js",
"types": ".",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this actually does anything... import '@testing-library/jest-dom/extend-expect'; from a TS file has always worked.

Again, the point of #123 was to cheat (a bit) and make the extend-expect typings available without needing any imports (i.e., make them "global" typings). But the only way to make them global typings is by moving them to DefinitelyTyped and defining them as global typings, rather than module typings.

This is something that the DT maintainers disagreed with, so barring some kind of TS compiler support for automatic global type resolution from types provided by npm packages, we are stuck.

Copy link
Author

@mrmckeb mrmckeb Oct 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, this did make a difference. Without this, it didn't work - I checked a few times.

However, I could get this to work otherwise.

import '@testing-library/jest-dom/extend-expect.d'

This may be environmental.

"engines": {
"node": ">=8",
"npm": ">=6"
Expand Down