<commit_before>
import { expect } from 'chai';

const RG = require('../../../client/src/battles');
RG.Random = require('../../../client/src/random');
RG.DungeonGenerator = require('../../../client/src/dungeon-generator');

describe('DungeonGenerator', function() {
    this.timeout(10000);
    it('generates dungeon levels', () => {
        RG.RAND.setSeed(new Date().getTime());
        const gen = new RG.DungeonGenerator();
        const conf = {
            nBigRooms: 0,
            errorOnFailure: true
        };
        for (let i = 0; i < 1; i++) {
            const cols = RG.RAND.getUniformInt(80, 120);
            const rows = RG.RAND.getUniformInt(28, 56);
            const level = gen.create(cols, rows, conf);
            console.log('Level ' + i + ' created:');
            level.debugPrintInASCII();
            expect(level).to.exist;
        }

    });
});<commit_msg>Added rerunOnFailure: true.<commit_after>
import { expect } from 'chai';

const RG = require('../../../client/src/battles');
RG.Random = require('../../../client/src/random');
RG.DungeonGenerator = require('../../../client/src/dungeon-generator');

describe('DungeonGenerator', function() {
    this.timeout(10000);
    it('generates dungeon levels', () => {
        RG.RAND.setSeed(new Date().getTime());
        const gen = new RG.DungeonGenerator();
        const conf = {
            nBigRooms: 0,
            rerunOnFailure: true
            // errorOnFailure: true
        };
        for (let i = 0; i < 20; i++) {
            const cols = RG.RAND.getUniformInt(80, 120);
            const rows = RG.RAND.getUniformInt(28, 56);
            const level = gen.create(cols, rows, conf);
            console.log('Level ' + i + ' created:');
            level.debugPrintInASCII();
            expect(level).to.exist;
        }

    });
});
{'fraction_non_alphanumeric': 0.17878622197922361, 'fraction_numerical': 0.01913613996719519, 'mean_word_length': 2.055091819699499, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '813296', 'n_tokens_mistral': 603, 'n_tokens_neox': 557, 'n_words': 114}