<commit_before>'use strict';
const Path = require('path');
const Chai = require('chai');
const expect = Chai.expect;
const Sinon = require('sinon');

const sinonChai = require('sinon-chai');
Chai.use(sinonChai);


const page = require(Path.resolve(__dirname, '../../../src/controllers/pageController.js'));
const Board = require('../../../src/model/Board');
const Game = require('../../../src/model/Game');
const Thread = require('../../../src/model/Thread');
const Post = require('../../../src/model/Post');
const User = require('../../../src/model/User');

const unauthenticatedFakeReq = (tbl) => {
	tbl.isAuthenticated = () => false;
	return tbl;
};

const authenticatedFakeReq = (tbl) => {
	tbl.isAuthenticated = () => true;
	tbl.user = {
		ID: 1,
		Username: 'FakeUser',
		Admin: false
	};
	return tbl;
};

describe('Page API controller', () => {
	let sandbox;

	beforeEach(() => {
		sandbox = Sinon.createSandbox();
	});

	afterEach( () => {
		sandbox.restore();
	});
<commit_msg>fix: broke the tests on accidet<commit_after>'use strict';
const Path = require('path');
const Chai = require('chai');
const expect = Chai.expect;
const Sinon = require('sinon');

const sinonChai = require('sinon-chai');
Chai.use(sinonChai);


const page = require(Path.resolve(__dirname, '../../../src/controllers/pageController.js'));
const Board = require('../../../src/model/Board');
const Game = require('../../../src/model/Game');
const Thread = require('../../../src/model/Thread');
const Post = require('../../../src/model/Post');
const User = require('../../../src/model/User');

const unauthenticatedFakeReq = (tbl) => {
	tbl.csrfToken = () => <PASSWORD>;
	tbl.isAuthenticated = () => false;
	return tbl;
};

const authenticatedFakeReq = (tbl) => {
	tbl.csrfToken = () => 12345;
	tbl.isAuthenticated = () => true;
	tbl.user = {
		ID: 1,
		Username: 'FakeUser',
		Admin: false
	};
	return tbl;
};

describe('Page API controller', () => {
	let sandbox;

	beforeEach(() => {
		sandbox = Sinon.createSandbox();
	});

	afterEach( () => {
		sandbox.restore();
	});

{'fraction_non_alphanumeric': 0.22822384428223844, 'fraction_numerical': 0.0034063260340632603, 'mean_word_length': 3.630630630630631, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 20, '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': '3292292', 'n_tokens_mistral': 722, 'n_tokens_neox': 685, 'n_words': 145}