<commit_before>import { transpileIfTypescript } from '../../src';

describe('transpileIfTypescript', () => {
    it('should ignore anything non-TS', () => {
        const contents = 'unaltered';
        expect(transpileIfTypescript('some.js', contents)).toBe(contents);
    });
    it('should be able to transpile some TS', () => {
        const ts = 'const x:string = "anything";';
        expect(transpileIfTypescript('some.ts', ts)).toMatch('var x = "anything";');
        expect(transpileIfTypescript('some.tsx', ts)).toMatch('var x = "anything";');
    });

    it('should be possible to pass a custom config', () => {
        const customTsConfigFile = 'not-existant.json';
        const customConfig = { __TS_CONFIG__: customTsConfigFile};
        expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
    });
});<commit_msg>Add new config schema tests<commit_after>import { transpileIfTypescript } from '../../src';

describe('transpileIfTypescript', () => {
    it('should ignore anything non-TS', () => {
        const contents = 'unaltered';
        expect(transpileIfTypescript('some.js', contents)).toBe(contents);
    });
    it('should be able to transpile some TS', () => {
        const ts = 'const x:string = "anything";';
        expect(transpileIfTypescript('some.ts', ts)).toMatch('var x = "anything";');
        expect(transpileIfTypescript('some.tsx', ts)).toMatch('var x = "anything";');
    });

    it('should be possible to pass a custom config (Deprecated)', () => {
        const customTsConfigFile = 'not-existant.json';
        const customConfig = { __TS_CONFIG__: customTsConfigFile };
        expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
    });

    it('should be possible to pass a custom config', () => {
        const customTsConfigFile = 'not-existant.json';
        const customConfig = { 'ts-jest': { tsConfigFile: customTsConfigFile }};
        expect(() => transpileIfTypescript('some.ts', '', customConfig)).toThrow(new RegExp(customTsConfigFile));
    });
});
{'fraction_non_alphanumeric': 0.17194142654700048, 'fraction_numerical': 0.0, 'mean_word_length': 3.7066666666666666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '4319056', 'n_tokens_mistral': 639, 'n_tokens_neox': 601, 'n_words': 131}