{"size": 1895, "ext": "js", "max_stars_repo_path": "test.js", "max_stars_repo_name": "mixsh/xilik", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test.js", "max_issues_repo_name": "mixsh/xilik", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test.js", "max_forks_repo_name": "mixsh/xilik", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.9589041096, "max_line_length": 79, "alphanum_fraction": 0.5947229551}
function run(config) {
    const wrapper = document.createElement('div')
    config.setup(wrapper)
    
    const p = document.createElement('p')
    const description = document.createElement('strong')
    description.innerHTML = config.description
    p.appendChild(description)
    
    try {
        const x = xilik(config.props, wrapper)

        if (config.test(x, wrapper)) {
            p.classList.add('green')
        }
        else {
            console.error('FAILED', config.description)
            p.classList.add('red')
        }
    }
    catch (error) {
        console.error('FAILED', error)
        p.innerHTML += '\n' + error
        p.classList.add('red')
    }

    wrapper.remove()
    
    const $testResultsWrapper = document.getElementById('test-results-wrapper')
    $testResultsWrapper.appendChild(p)
}

function update(element, value) {
    element.value = value
    element.dispatchEvent(new Event('input'))
}

run({
    description: '$input.value should change after changing x.props.theInput',
    props: {
        theInput: 123,
    },
    setup: wrapper => {
        const $input = document.createElement('input')
        $input.id = 'theInput'
        $input.type = 'number'
        wrapper.appendChild($input)
    },
    test: (xilik, wrapper) => {
        xilik.props.theInput = 456
        return xilik.props.theInput == wrapper.children.theInput.value
    }
})

run({
    description: 'x.props.input2 should change after changing $input2.value',
    props: {
        theInput: 123,
    },
    setup: wrapper => {
        const $input = document.createElement('input')
        $input.id = 'theInput'
        $input.type = 'number'
        wrapper.appendChild($input)
    },
    test: (xilik, wrapper) => {
        const $input = wrapper.children.theInput
        update($input, 777)

        return xilik.props.theInput.toString() == $input.value
    }
})
