<commit_before>
import HalsonConfigurator from '../HalsonConfigurator';

describe('HalsonConfigurator', () => {

	const API_ROOT = 'http://localhost/api';
	const LINK_MAP_RESOLVER = body => body._links;

	it('should fetch the configuration', (done) => {
		let httpAgentCalled = false;
		let httpAgent = {
			get(url) {
				expect(url).toBe(API_ROOT);
				return Promise.resolve({
					status: 200,
					body: { _links: { stuff: 'stuff too' } },
					params: {
						method: 'GET',
						url,
						transformedUrl: url,
						data: {},
						headers: {}
					},
					headers: {},
					cached: false
				});
			}
		};
		
		let configurator = new HalsonConfigurator(
			httpAgent,
			API_ROOT,
			LINK_MAP_RESOLVER
		);
		configurator.getConfiguration().then((configurator) => {
			expect(configurator).toEqual({
				links: { stuff: 'stuff too' },
				apiRoot: API_ROOT
			});
			done();
		}).catch((error) => {
			fail(error.stack)
			done()
		});
	});

});<commit_msg>fixed the tests to reflect the current behavior of the configurator<commit_after>
import HalsonConfigurator from '../HalsonConfigurator';

describe('HalsonConfigurator', () => {

	const API_ROOT = 'http://localhost/api';
	const LINK_MAP_RESOLVER = body => body._links;

	it('should fetch the configuration', (done) => {
		let httpAgent = {
			get(url) {
				expect(url).toBe(API_ROOT + '/');
				return Promise.resolve({
					status: 200,
					body: { _links: { stuff: 'stuff too' } },
					params: {
						method: 'GET',
						url,
						transformedUrl: url,
						data: {},
						headers: {}
					},
					headers: {},
					cached: false
				});
			}
		};
		
		let configurator = new HalsonConfigurator(
			httpAgent,
			API_ROOT,
			LINK_MAP_RESOLVER
		);
		configurator.getConfiguration().then((configurator) => {
			expect(configurator).toEqual({
				links: { stuff: 'stuff too' },
				apiRoot: API_ROOT
			});
			done();
		}).catch((error) => {
			fail(error.stack);
			done();
		});
	});

});
{'fraction_non_alphanumeric': 0.1597964376590331, 'fraction_numerical': 0.0030534351145038168, 'mean_word_length': 2.87007874015748, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2125188', 'n_tokens_mistral': 867, 'n_tokens_neox': 662, 'n_words': 135}