<commit_before>import * as core from 'core'
import * as jsxFactory from 'html/jsxFactory'

describe('jsxFactory', () => {

    it('creates a TextNodeDescriptor from an expression inside an element', () => {

        const view = <div>{'some text'}</div> as core.ElementNodeDescriptor

        expect(view.children[0]).toEqual({
            __type: 'text',
            value: 'some text'
        } as core.TextNodeDescriptor)
    })

    it('creates a NothingNodeDescriptor from a <nothing /> tag', () => {

        const view = <nothing />

        expect(view).toEqual({
            __type: 'nothing'
        } as core.NothingNodeDescriptor)
    })

    it('creates an ElementNodeDescriptor with the supplied tagName', () => {

        const view = <div></div> as core.ElementNodeDescriptor

        expect(view).toEqual({
            __type: 'element',
            tagName: 'div',
            attributes: {},
            children: []
        } as core.ElementNodeDescriptor)
    })

    it('creates an ElementNodeDescriptor and sets attributes', () => {

        const fn = () => 0
        const view = <div class="test" id="test" onclick={fn}></div>

        expect(view).toEqual({
            __type: 'element',
            tagName: 'div',
            attributes: {
                'class': 'test',
                id: 'test',
                onclick: fn
            },
            children: []
        } as core.ElementNodeDescriptor)
    })

     const childNodeDescriptor = {
        __type: 'element',
        tagName: 'div',<commit_msg>Clean up<commit_after>import * as core from 'core'
import * as jsxFactory from 'html/jsxFactory'

describe('jsxFactory', () => {

    it('creates a TextNodeDescriptor from an expression inside an element', () => {

        const view = <div>{'some text'}</div>

        expect(view.children[0]).toEqual({
            __type: 'text',
            value: 'some text'
        } as core.TextNodeDescriptor)
    })

    it('creates a NothingNodeDescriptor from a <nothing /> tag', () => {

        const view = <nothing />

        expect(view).toEqual({
            __type: 'nothing'
        } as core.NothingNodeDescriptor)
    })

    it('creates an ElementNodeDescriptor with the supplied tagName', () => {

        const view = <div></div>

        expect(view).toEqual({
            __type: 'element',
            tagName: 'div',
            attributes: {},
            children: []
        } as core.ElementNodeDescriptor)
    })

    it('creates an ElementNodeDescriptor and sets attributes', () => {

        const fn = () => 0
        const view = <div class="test" id="test" onclick={fn}></div>

        expect(view).toEqual({
            __type: 'element',
            tagName: 'div',
            attributes: {
                'class': 'test',
                id: 'test',
                onclick: fn
            },
            children: []
        } as core.ElementNodeDescriptor)
    })

     const childNodeDescriptor = {
        __type: 'element',
        tagName: 'div',
{'fraction_non_alphanumeric': 0.13421487603305784, 'fraction_numerical': 0.001322314049586777, 'mean_word_length': 1.8874045801526718, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 31, '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': '6401205', 'n_tokens_mistral': 840, 'n_tokens_neox': 807, 'n_words': 208}