Add test for getGuildCount
All checks were successful
discord bot tests / discord bot tests (push) Successful in 11s
All checks were successful
discord bot tests / discord bot tests (push) Successful in 11s
This commit is contained in:
parent
7179260cff
commit
ee6debb715
1 changed files with 17 additions and 0 deletions
17
tests/getGuildCount.test.js
Normal file
17
tests/getGuildCount.test.js
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
Loading…
Add table
Reference in a new issue