Suite of AT Protocol TypeScript libraries built on web standards
21
fork

Configure Feed

Select the types of activity you want to include in your feed.

faster tests

+11 -11
+2 -2
identity/tests/did-cache_test.ts
··· 83 83 84 84 // let's mess with the cached doc so we get something different 85 85 didCache.cacheDid(did, { ...doc, id: "did:example:alice" }); 86 - await wait(5); 86 + await wait(1); 87 87 88 88 // first check the cache & see that we have the stale value 89 89 const cached = shortCacheResolver.cache?.checkCache(did); ··· 112 112 113 113 // again, we mess with the cached doc so we get something different 114 114 didCache.cacheDid(did, { ...doc, id: "did:example:alice" }); 115 - await wait(5); 115 + await wait(1); 116 116 117 117 // see that the resolver does not return expired value & instead force refreshes 118 118 const staleGet = await shortExpireResolver.resolve(did);
+1 -1
repo/tests/car_test.ts
··· 44 44 Deno.test("writeCar propagates errors", async () => { 45 45 const iterate = async () => { 46 46 async function* blockIterator() { 47 - await wait(1); 47 + await wait(0); 48 48 const block = await dataToCborBlock({ test: 1 }); 49 49 yield block; 50 50 throw new Error("Oops!");
+8 -8
sync/tests/runner_test.ts
··· 29 29 const complete: number[] = []; 30 30 // partition 1 items start slow but get faster: slow should still complete first. 31 31 runner.addTask("1", async () => { 32 - await wait(30); 32 + await wait(8); 33 33 complete.push(11); 34 34 }); 35 35 runner.addTask("1", async () => { 36 - await wait(20); 36 + await wait(4); 37 37 complete.push(12); 38 38 }); 39 39 runner.addTask("1", async () => { 40 - await wait(1); 40 + await wait(0); 41 41 complete.push(13); 42 42 }); 43 43 assertEquals(runner.partitions.size, 1); 44 44 // partition 2 items complete quickly except the last, which is slowest of all events. 45 45 runner.addTask("2", async () => { 46 - await wait(1); 46 + await wait(0); 47 47 complete.push(21); 48 48 }); 49 49 runner.addTask("2", async () => { ··· 55 55 complete.push(23); 56 56 }); 57 57 runner.addTask("2", async () => { 58 - await wait(60); 58 + await wait(10); 59 59 complete.push(24); 60 60 }); 61 61 assertEquals(runner.partitions.size, 2); ··· 70 70 // if concurrency were not constrained, partition 1 would complete all items 71 71 // before any items from partition 2. since it is constrained, the work is complete in the order added. 72 72 runner.addTask("1", async () => { 73 - await wait(1); 73 + await wait(0); 74 74 complete.push(11); 75 75 }); 76 76 runner.addTask("2", async () => { 77 - await wait(10); 77 + await wait(2); 78 78 complete.push(21); 79 79 }); 80 80 runner.addTask("1", async () => { ··· 82 82 complete.push(12); 83 83 }); 84 84 runner.addTask("2", async () => { 85 - await wait(10); 85 + await wait(5); 86 86 complete.push(22); 87 87 }); 88 88 // only partition 1 exists so far due to the concurrency