discord_bot/tests/getGuildCount.test.js
SileNce5k ee6debb715
All checks were successful
discord bot tests / discord bot tests (push) Successful in 11s
Add test for getGuildCount
2024-10-25 22:10:03 +02:00

17 lines
No EOL
429 B
JavaScript

const getGuildCount = require('../util/getGuildCount');
test("Testing getGuildCount", () => {
for(let i = 1; i < 200000; i = i+i*30 ){
let client = {guilds: {cache: new Map()}}
client.guilds.cache.each = client.guilds.cache.forEach;
for(let j = 0; j < i; j++){
client.guilds.cache.set(`num: ${j}`, j);
}
expect(getGuildCount(client)).toBe(i);
}
})