Replies: 8 comments
-
Mind packaging this up into a runnable example that reproduces the issue? Without this, it's less likely someone picks it up. |
Beta Was this translation helpful? Give feedback.
-
I'd assume this is something that needs tweaking in your test environment, and less so a bug in viem. Moving to discussion. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the prompt answer. I was able to reproduce the bug here Just login and run |
Beta Was this translation helpful? Give feedback.
-
first time using replit with projen, so if you need to be explicitly invited to run command line commands, just drop your replit username and 'll add you |
Beta Was this translation helpful? Give feedback.
-
I've debugged more today, and I can see the problem down to When that function calls Specifically this error does NOT happen when calling the I suspect the issue starts in my import { TextEncoder } from 'util';
// required by viem library to run properly - see import inside .projenrc.ts
global.TextEncoder = TextEncoder; This is the encoder used inside |
Beta Was this translation helpful? Give feedback.
-
I have good news, as I changed it to This is how my import { TextEncoder, TextDecoder } from 'text-encoding';
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder; What I find stange is that I'm running jest with |
Beta Was this translation helpful? Give feedback.
-
As an extra reference, here's the point - jestjs/jest#13227 Looks like this is a jest issue, not easy to test. Just curious: did you have issue when testing |
Beta Was this translation helpful? Give feedback.
-
Ran into something similar and tracked back to test environment, specifically: vitest-dev/vitest#4043 (comment)
For me switching from jsdom to node in my vitest config fixed the issue. |
Beta Was this translation helpful? Give feedback.
-
Is there an existing issue for this?
Package Version
1.10.14
Current Behavior
I'm creating a React plugin, to be later published on NPM, and I'm doing that with a test-driven approach. I'm encountering issues when using the function
privateKeyToAccount();
inside my test, and when the function is called I get the following errorExpected Behavior
To ingest correctly the private key and return an object of type
Account
.Steps To Reproduce
Create a
projen
application with the following.projenrc.ts
The
jest.setup.ts
file mentioned has the following structurethen edit also the default test provided by projen with the following content
Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
No response
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions