<commit_before>import * as assert from 'assert';
import { IMock, Mock, It, Times } from "typemoq";
import { TableFactory } from "../../src/modelFactory/tableFactory";
import { TableValidator } from "../../src/modelFactory/tableValidator";

suite("TableFactory tests", () => {
    let _mockValidator: IMock<TableValidator>;

    beforeEach(function(){
        _mockValidator = Mock.ofType<TableValidator>();
    });

    test("Invalid table throws error and calls validator", () => {
        const tableText = "invalid";
        _mockValidator.setup(m => m.isValid(It.isAny(), true)).returns(() => false).verifiable(Times.once());
        const sut = createFactory();

        assert.throws(() => sut.getModel(tableText))
        _mockValidator.verifyAll();
    });<commit_msg>Change beforeEach to setup to avoid 'ReferenceError: beforeEach is not defined'.<commit_after>import * as assert from 'assert';
import { IMock, Mock, It, Times } from "typemoq";
import { TableFactory } from "../../src/modelFactory/tableFactory";
import { TableValidator } from "../../src/modelFactory/tableValidator";

suite("TableFactory tests", () => {
    let _mockValidator: IMock<TableValidator>;

    setup(() => {
        _mockValidator = Mock.ofType<TableValidator>();
    });

    test("Invalid table throws error and calls validator", () => {
        const tableText = "invalid";
        _mockValidator.setup(m => m.isValid(It.isAny(), true)).returns(() => false).verifiable(Times.once());
        const sut = createFactory();

        assert.throws(() => sut.getModel(tableText))
        _mockValidator.verifyAll();
    });
{'fraction_non_alphanumeric': 0.16273291925465838, 'fraction_numerical': 0.0, 'mean_word_length': 3.6560693641618496, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 18, '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': '6704918', 'n_tokens_mistral': 442, 'n_tokens_neox': 435, 'n_words': 106}