React-testing-library: No type definitions for react/pure

Created on 5 Jun 2020  路  3Comments  路  Source: testing-library/react-testing-library

Relevant code or config:

import { render } from "@testing-library/react/pure";

What happened:

TS7016: Could not find a declaration file for module '@testing-library/react/pure'.

Reproduction:

https://codesandbox.io/s/nifty-tharp-3de0h?file=/src/index.ts:61-114

Problem description:

This is happening because the pure.d.ts file is not next to pure.js, it's in a types folder and TS doesn't know how to link it. It's OK for the entry index because there's a pkg.types pointing to it, but importing something else requires the type file to be colocated.

Suggested solution:

I think the files could either be moved next to their corresponding .js files and the build step updated to include them, or have a separate build step that does cp types/*.d.ts dist/.

released

All 3 comments

I think this should fix it: https://github.com/testing-library/react-testing-library/pull/696

Could you confirm?

:tada: This issue has been resolved in version 10.2.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Thanks @NiGhTTraX for catching this!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nagacoder picture nagacoder  路  3Comments

jalvarado91 picture jalvarado91  路  3Comments

jaredmeakin picture jaredmeakin  路  3Comments

suresh777 picture suresh777  路  3Comments

good-idea picture good-idea  路  4Comments