mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 04:42:57 +00:00
update
This commit is contained in:
1 parent
281a6511f1
commit
42edebcf6d
45 files changed
+8446
-1010
No files matched your search
@@ -540,6 +540,28 @@ test(
|
||||
},
|
||||
);
|
||||
|
||||
test("ensureLoaded memoizes concurrent loads", async () => {
|
||||
const SubscriptionsManager = subscriptions.constructor;
|
||||
const manager = new SubscriptionsManager();
|
||||
|
||||
let loadCount = 0;
|
||||
manager.loadSubscriptions = async () => {
|
||||
loadCount += 1;
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
manager.loaded = true;
|
||||
};
|
||||
|
||||
const actorHex = "f".repeat(64);
|
||||
|
||||
await Promise.all([
|
||||
manager.ensureLoaded(actorHex),
|
||||
manager.ensureLoaded(actorHex),
|
||||
]);
|
||||
|
||||
assert.equal(loadCount, 1, "loadSubscriptions should only run once");
|
||||
assert.equal(manager.loaded, true, "manager should be marked as loaded");
|
||||
});
|
||||
|
||||
test(
|
||||
"publishSubscriptionList succeeds with direct signer without requesting extension permissions",
|
||||
async () => {
|
||||
|
||||
Reference in new issue
Block a user