Danielduel
Skipping time in tests; time delay setTimeout setInterval
(the title is just so people can get to this one easier by using search)
I have a deadline/delay based (@std/async) functionality and in tests I want to skip time (so I don't have to pass lower values for timeouts).
I want something like jest's
advanceTimersByTime
(very bright page warning, usage is at the bottom) https://jestjs.io/docs/timer-mocks
(jest uses sinon's fake timers, sinon uses sinon/fake-timers (install, then createClock, it's basically a big orchiestrated mock on time-based apis))
No idea if sinon works with deno (and if it is the deno's way), I would prefer something jsr/deno for this, any recommendation?5 replies
Deno.test with "each" support
I tried to find in docs if something like
https://deno.land/x/test_each@v0.0.2
or jest's https://jestjs.io/docs/api#each
exists in Deno.test
Looks like it is not, if you know that I missed something or there's a common pattern of doing this in Deno.test (like idk... mapping an array into an array of asserts and somehow getting the correct message out - please steer me into the correct direction.
2 replies
Missing resource in deno's docs
https://docs.deno.com/runtime/manual/basics/testing/assertions
Leads to not existing chai example, please remove.
3 replies
Recommended `denoland/deno` contributor editor setup
I have a problem with deno trying to redefine itself via random
declare namespace Deno { ... }
throughout the deno repo.
I use vscodium with TypeScript 5.2.2, latest Deno.
I fail to find any docs on how you recommend to setup the editor to make lsp correctly pick up things.5 replies
Deno+vite crashes on node dependency
Earlier today I was happy because everything worked on my m1 macbook.
When I've returned home (arch) I got errors from latest deno...
(I am running deno on the metal, but I will provide a way to reproduce it with docker:)
12 replies
Peer dependency
Can I somehow mark a dependency as "peer"?
So this dependency (which is known to shuffle typings between versions, but generally it is nonbreaking if you use it on highlevel) will not enforce a specific version onto a project?
I depend on Pentagon and Zod
Pentagon also depends on Zod
While I initially wanted to use different version of Zod than pentagon's
(using different versions of Zod makes some inner types clash)
(I can switch zod version to pentagon's, but I feel not everybody would have the same luxury in the future)
If possible - I would like to avoid this solution: https://github.com/denoland/deno/issues/10356#issuecomment-1580352563
4 replies