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

[BUG] Can not write unit test if i import this library. I use jest, testing-library and styled-components #53

Closed
hhtrung55 opened this issue May 10, 2023 · 5 comments

Comments

@hhtrung55
Copy link

image

@VuCoKhoi
Copy link

I have the same problem!!!

@cfuisat
Copy link

cfuisat commented May 11, 2023

Hi,
you need to create a .d.ts file in your project root folder where package.json file exists,
example: global.d.ts and include the below line
// global.d.ts
declare module "@cardano-foundation/cardano-connect-with-wallet"

Also, you should also be listed as a part of your project in your tsconfig.json
"include": [ "**/*.ts", "**/*.tsx", "global.d.ts" ],

See if it fix the issue.

@fabianbormann
Copy link
Contributor

We will look into this. Thanks for opening the issue.

@fabianbormann
Copy link
Contributor

We use cypress for testing maybe your jest tests are matching to that .test files name pattern and this causes the error. I wiill check if it's possible to change our name pattern to not confuse your test setup

@fabianbormann
Copy link
Contributor

@cfuisat your issue has been fixed by the latest release 0.1.57. It was just a wrong path to the type declarations :) .. But I think the issue of @hhtrung55 and @VuCoKhoi is regarding to this cypress-io/cypress#22059 . @hhtrung55 I have no jest running. Can you please try this solution and tell me if it works? cypress-io/cypress#22059 (comment) A PR would be great 👍

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

5 participants
@fabianbormann @VuCoKhoi @hhtrung55 @cfuisat and others