Add some simple load tests

This commit is contained in:
Gabe Kangas
2020-07-15 21:23:41 -07:00
parent a8fe8a1cfa
commit aebbce4b76
5 changed files with 2029 additions and 0 deletions

14
test/websocketTest.js Normal file
View File

@@ -0,0 +1,14 @@
module.exports = { createTestMessageObject };
function createTestMessageObject(userContext, events, done) {
const randomNumber = Math.floor((Math.random() * 10) + 1);
const author = "load-test-user-" + randomNumber
const data = {
author: author,
body: "Test 12345. " + randomNumber,
image: "https://robohash.org/" + author + "?size=80x80&set=set3"
};
// set the "data" variable for the virtual user to use in the subsequent action
userContext.vars.data = data;
return done();
}