MCPcopy Create free account
hub / github.com/Botloader/botloader / testGetAll

Function testGetAll

integration-tests/tasks_get.ts:18–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16}
17
18async function testGetAll() {
19 for (let i = 0; i < 55; i++) {
20 await Tasks.schedule("get_many", new Date(Date.now() + 1000000), { key: "" + i });
21 await Tasks.schedule("get_many2", new Date(Date.now() + 1000000), { key: "" + i });
22 }
23
24 const inNamespace = await countAll("get_many");
25 if (inNamespace !== 55) {
26 throw new Error(`${inNamespace} !== 55`)
27 }
28
29 const all = await countAll();
30 // other scripts are running, so we we have no idea how many there is overall, but it should be atleast 200
31 if (all < 110) {
32 throw new Error(`${inNamespace} < 110`)
33 }
34}
35
36async function countAll(namespace?: string): Promise<number> {
37 let last = 0;

Callers 1

tasks_get.tsFile · 0.70

Calls 2

scheduleMethod · 0.80
countAllFunction · 0.70

Tested by

no test coverage detected