Skip to content

Commit

Permalink
fix(zen mode): test automatically stopping after 100 words
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Apr 30, 2024
1 parent 4eccfd6 commit 3dda3f9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frontend/src/ts/test/words-generator.ts
Expand Up @@ -383,6 +383,10 @@ export function getWordOrder(): MonkeyTypes.FunboxWordOrder {
}

export function getWordsLimit(): number {
if (Config.mode === "zen") {
return 0;
}

let limit = 100;

const funboxToPush =
Expand Down Expand Up @@ -595,6 +599,8 @@ export async function generateWords(
wordList = CustomText.getText();
} else if (Config.mode === "quote") {
wordList = await getQuoteWordList(language, wordOrder);
} else if (Config.mode === "zen") {
wordList = [];
}

const limit = getWordsLimit();
Expand All @@ -607,6 +613,10 @@ export async function generateWords(
currentWordset = await Wordset.withWords(wordList);
console.debug("Wordset", currentWordset);

if (limit === 0) {
return ret;
}

let stop = false;
let i = 0;
while (!stop) {
Expand Down

0 comments on commit 3dda3f9

Please sign in to comment.