fix(core): update

This commit is contained in:
2020-12-16 02:20:28 +00:00
parent 4bf5456a1d
commit 1a44d2027c
4 changed files with 1164 additions and 1149 deletions

View File

@ -87,17 +87,23 @@ tap.test('2 clients should connect in parallel', async () => {
});
tap.test('should be able to make a functionCall from client to server', async () => {
const totalCycles = 20000
const totalCycles = 20000;
let counter = 0;
let startTime = Date.now();
while (counter < totalCycles) {
const response = await testSmartsocketClient.serverCall('testFunction1', {
value1: 'hello',
const randomString = `hello ${Math.random()}`;
const response: any = await testSmartsocketClient.serverCall('testFunction1', {
value1: randomString,
});
expect(response.value1).to.equal(randomString);
if (counter % 100 === 0) {
console.log(`processed 100 more messages in ${Date.now() - startTime}ms. ${totalCycles - counter} messages to go.`);
console.log(
`processed 100 more messages in ${Date.now() - startTime}ms. ${
totalCycles - counter
} messages to go.`
);
startTime = Date.now();
};
}
counter++;
}
});