<commit_before>
const expect = require('chai').expect;
// const RG = require('../../../client/src/battles');

const Creator = require('../../../client/src/world.creator');

describe('World.Creator', () => {
    it('can create a configuration to build the game world', () => {
        // Of course creator which creates the configuration needs to have its
        // own configuration. Maybe there will be World.Creator.ConfCreator?
        const creator = new Creator();

        const worldConf = creator.createWorldConf({name: 'Westeros'});
        expect(worldConf.name).to.equal('Westeros');

        const conf2 = creator.createWorldConf(
            {name: 'Northern Lands',
                difficulty: 'Easy', areaSize: 'Medium', worldSize: 'Medium',
                items: 'Abundant',
                climate: 'cold', monsters: 'Sparse', elevation: 'High',
                excavation: 'Medium', population: 'Low'
            }
        );

        expect(conf2.nAreas).to.equal(2);
        expect(conf2).to.have.property('playerStart');
        expect(conf2).to.have.property('area');

        const areas = conf2.area;

        expect(areas[0].dungeon).to.have.length.above(0);

    });
});<commit_msg>Added a test to check that city config is created properly.<commit_after>
const expect = require('chai').expect;
// const RG = require('../../../client/src/battles');

const Creator = require('../../../client/src/world.creator');

describe('World.Creator', () => {
    it('can create a configuration to build the game world', () => {
        // Of course creator which creates the configuration needs to have its
        // own configuration. Maybe there will be World.Creator.ConfCreator?
        const creator = new Creator();

        const worldConf = creator.createWorldConf({name: 'Westeros'});
        expect(worldConf.name).to.equal('Westeros');

        const conf2 = creator.createWorldConf(
            {name: 'Northern Lands',
                difficulty: 'Easy', areaSize: 'Medium', worldSize: 'Medium',
                items: 'Abundant',
                climate: 'cold', monsters: 'Sparse', elevation: 'High',
                excavation: 'Medium', population: 'Low'
            }
        );

        expect(conf2.nAreas).to.equal(2);
        expect(conf2).to.have.property('playerStart');
        expect(conf2).to.have.property('area');

        const areas = conf2.area;
        expect(areas[0].dungeon).to.have.length.above(0);
    });

    it('adds cities to the created configuration', () => {
        const creator = new Creator();
        const conf = creator.createWorldConf({name: 'My World'});

        const area0 = conf.area[0];

        expect(area0.nCities).to.be.above(0);

        console.log(JSON.stringify(area0));

        const city0 = area0.city[0];
        expect(city0.quarter).to.have.length.above(0);
    });
});
{'fraction_non_alphanumeric': 0.15704791885274572, 'fraction_numerical': 0.009094088842252535, 'mean_word_length': 2.4582829504232167, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '2351088', 'n_tokens_mistral': 856, 'n_tokens_neox': 802, 'n_words': 190}