<commit_before>const plugin = require('./');

const postcss = require('postcss');

function run(input, output) {
    return postcss([ plugin ]).process(input).then( result => {
        expect(result.css).toEqual(output);
        expect(result.warnings().length).toEqual(0);
    });
}

it('adds focus selector', () => {
    return run('a:hover, b {}', 'a:hover, b, a:focus {}');
});

it('adds focus selector', () => {
    return run(
        'a:hover, b:hover {}',
        'a:hover, b:hover, a:focus, b:focus {}'
    );
});

it('ignores hover selector because of focus', () => {
    return run(
        'a:hover, b:hover { color: white; } ' +
            'b:focus { color: black; } @media { b:hover { } }',
        'a:hover, b:hover, a:focus { color: white; } ' +
            'b:focus { color: black; } @media { b:hover, b:focus { } }'
    );
});<commit_msg>Improve test coverage<commit_after>const plugin = require('./');

const postcss = require('postcss');

function run(input, output) {
    return postcss([ plugin ]).process(input).then( result => {
        expect(result.css).toEqual(output);
        expect(result.warnings().length).toEqual(0);
    });
}

it('adds focus selector', () => {
    return run('a:hover, b {}', 'a:hover, b, a:focus {}');
});

it('adds focus selector', () => {
    return run(
        'a:hover, b:hover {}',
        'a:hover, b:hover, a:focus, b:focus {}'
    );
});

it('ignores hover selector because of focus', () => {
    return run(
        '.foo:hover {} .foo:focus {} ' +
            'a:hover, b:hover {} ' +
            'b:focus {} ' +
            '@media { b:hover {} }',
        '.foo:hover {} .foo:focus {} ' +
            'a:hover, b:hover, a:focus {} ' +
            'b:focus {} ' +
            '@media { b:hover, b:focus {} }'
    );
});
{'fraction_non_alphanumeric': 0.21748878923766815, 'fraction_numerical': 0.0011210762331838565, 'mean_word_length': 2.562874251497006, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4459997', 'n_tokens_mistral': 599, 'n_tokens_neox': 603, 'n_words': 126}