You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Optimize unit tests: nip05.spec.ts & nip03.spec.ts (network) #610
Hii @cameri , I dug into this and found that nip03.spec.ts is completely synchronous. It is just a binary parser with no network activity at all. The async tests in nip05.spec.ts rely on stub.resolves, which fires as a microtask rather than real IO. All 76 tests finish in roughly 40 ms locally.
I did clean up the structural stuff though. I hoisted the stub lifecycle into the before and after hooks, pulled the SSRF guard out so it only runs once instead of repeating it for every test, and created the shared buffers ahead of time at module scope. Happy to open a PR if this helps.
@Anshumancanrock Okay not sure why it was taking longer on my machine when I inspected these tests. I'd appreciate if you open a PR with your structural changes.
Activity
Ferryx349 commentedon May 23, 2026
@Anshumancanrock have u started working around it, or still up to grab?
Anshumancanrock commentedon May 28, 2026
Hii @cameri , I dug into this and found that
nip03.spec.tsis completely synchronous. It is just a binary parser with no network activity at all. The async tests innip05.spec.tsrely on stub.resolves, which fires as a microtask rather than real IO. All 76 tests finish in roughly 40 ms locally.I did clean up the structural stuff though. I hoisted the stub lifecycle into the before and after hooks, pulled the SSRF guard out so it only runs once instead of repeating it for every test, and created the shared buffers ahead of time at module scope. Happy to open a PR if this helps.
cameri commentedon May 28, 2026
@Anshumancanrock Okay not sure why it was taking longer on my machine when I inspected these tests. I'd appreciate if you open a PR with your structural changes.