()
| 58 | } |
| 59 | |
| 60 | async function testGetAll() { |
| 61 | for (let i = 0; i < 55; i++) { |
| 62 | await bucket.schedule({ executeAt: new Date(Date.now() + 1000000), key: "" + i }); |
| 63 | await anotherBucket.schedule({ executeAt: new Date(Date.now() + 1000000), key: "100" + i }); |
| 64 | await bucketPluginCustom.schedule({ executeAt: new Date(Date.now() + 1000000), key: "10000" + i }); |
| 65 | } |
| 66 | |
| 67 | const inNamespace = await countAll(bucket); |
| 68 | assertExpected(55, inNamespace) |
| 69 | |
| 70 | const inPlugin = await countAll(bucketPluginCustom); |
| 71 | assertExpected(55, inPlugin) |
| 72 | |
| 73 | const all = await countAll(); |
| 74 | // other scripts are running, so we we have no idea how many there is overall, but it should be atleast 200 |
| 75 | if (all < 110) { |
| 76 | throw new Error(`${inNamespace} < 110`) |
| 77 | } |
| 78 | |
| 79 | await bucket.deleteAll() |
| 80 | await anotherBucket.deleteAll() |
| 81 | await bucketPluginCustom.deleteAll() |
| 82 | } |
| 83 | |
| 84 | async function countAll(bucket?: Tasks.TaskBucket): Promise<number> { |
| 85 | let last = 0; |
no test coverage detected