mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
fix: add regression test
This commit is contained in:
@@ -350,6 +350,21 @@ Meteor.methods({
|
||||
},
|
||||
});
|
||||
|
||||
Meteor.publish("livedata_server_test_sub_chain", async function () {
|
||||
await new Promise(r => setTimeout(r, 2000));
|
||||
this.ready();
|
||||
return null;
|
||||
});
|
||||
|
||||
Tinytest.addAsync("livedata server - waiting for subscription chain", (test, onComplete) => makeTestConnection(test, async (clientConn, serverConn) => {
|
||||
const handlers = [];
|
||||
for(let i=0; i< 10; i++){
|
||||
handlers.push(clientConn.subscribe('livedata_server_test_sub_chain'));
|
||||
}
|
||||
await new Promise(r => setTimeout(r, 3000));
|
||||
test.equal(handlers.map(sub => sub.ready()).filter(o=>o).length === 1, true);
|
||||
onComplete();
|
||||
}));
|
||||
Tinytest.addAsync("livedata server - waiting for Promise", (test, onComplete) =>
|
||||
makeTestConnection(test, async (clientConn, serverConn) => {
|
||||
const testResolvedPromiseResult = await clientConn.callAsync(
|
||||
|
||||
Reference in New Issue
Block a user