<commit_before>import { readFileSync as readFile } from 'fs';
import test from 'ava';
import detectBadges from '../../';

test('readme files: self', t => {
    const badges = detectBadges(readFile('../../README.md').toString());

    t.same(badges[0], {
        urls: {
            original: 'http://img.shields.io/npm/v/detect-readme-badges.svg?style=flat-square',
            shields: 'https://img.shields.io/npm/v/detect-readme-badges.svg',
            content: 'https://img.shields.io/npm/v/detect-readme-badges.json',
        },
        info: { service: 'npm', type: 'version', modifiers: { type: 'v' } },
    });
    t.same(badges[1], {
        urls: {
            original: 'http://img.shields.io/travis/IndigoUnited/node-detect-readme-badges/master.svg&style=flat-square',
            service: 'https://api.travis-ci.org/IndigoUnited/node-detect-readme-badges.svg?branch=master',
            shields: 'https://img.shields.io/travis/IndigoUnited/node-detect-readme-badges/master.svg',
            content: 'https://img.shields.io/travis/IndigoUnited/node-detect-readme-badges/master.json',
        },
        info: {
            service: 'travis',
            type: 'build',
            modifiers: { branch: 'master' },
        },
    });
    t.same(badges[2], {
        urls: {
            original: 'https://img.shields.io/coveralls/IndigoUnited/node-detect-readme-badges/master.svg&style=flat-square',
            service: 'https://coveralls.io/repos/IndigoUnited/node-detect-readme-badges/badge.svg?branch=master',
            shields: 'https://img.shields.io/coveralls/IndigoUnited/node-detect-readme-badges/master.svg',
            content: 'https://img.shields.io/coveralls/IndigoUnited/node-detect-readme-badges/master.json',
        },
        info: {
            service: 'coveralls',
            type: 'coverage',
            modifiers: { branch: 'master' },
        },
    });
    t.same(badges[3], {
        urls: {
            original: 'https://img.shields.io/david/IndigoUnited/node-detect-readme-badges.svg?style=flat-square',
            service: 'https://david-dm.org/IndigoUnited/node-detect-readme-badges.svg',
            shields: 'https://img.shields.io/david/IndigoUnited/node-detect-readme-badges.svg',
            content: 'https://img.shields.io/david/IndigoUnited/node-detect-readme-badges.json',
        },
        info: {
            service: 'david',
            type: 'dependencies',
            modifiers: { statusType: 'normal' },
        },
    });
    t.same(badges[4], {<commit_msg>Fix tests.<commit_after>import { readFileSync as readFile } from 'fs';
import test from 'ava';
import detectBadges from '../../';

test('readme files: self', t => {
    const badges = detectBadges(readFile('../../README.md').toString());

    t.same(badges[0], {
        urls: {
            original: 'http://img.shields.io/npm/v/detect-readme-badges.svg?style=flat-square',
            shields: 'https://img.shields.io/npm/v/detect-readme-badges.svg',
            content: 'https://img.shields.io/npm/v/detect-readme-badges.json',
        },
        info: { service: 'npm', type: 'version', modifiers: { type: 'v' } },
    });
    t.same(badges[1], {
        urls: {
            original: 'http://img.shields.io/travis/IndigoUnited/node-detect-readme-badges/master.svg?style=flat-square',
            service: 'https://api.travis-ci.org/IndigoUnited/node-detect-readme-badges.svg?branch=master',
            shields: 'https://img.shields.io/travis/IndigoUnited/node-detect-readme-badges/master.svg',
            content: 'https://img.shields.io/travis/IndigoUnited/node-detect-readme-badges/master.json',
        },
        info: {
            service: 'travis',
            type: 'build',
            modifiers: { branch: 'master' },
        },
    });
    t.same(badges[2], {
        urls: {
            original: 'https://img.shields.io/coveralls/IndigoUnited/node-detect-readme-badges/master.svg?style=flat-square',
            service: 'https://coveralls.io/repos/IndigoUnited/node-detect-readme-badges/badge.svg?branch=master',
            shields: 'https://img.shields.io/coveralls/IndigoUnited/node-detect-readme-badges/master.svg',
            content: 'https://img.shields.io/coveralls/IndigoUnited/node-detect-readme-badges/master.json',
        },
        info: {
            service: 'coveralls',
            type: 'coverage',
            modifiers: { branch: 'master' },
        },
    });
    t.same(badges[3], {
        urls: {
            original: 'https://img.shields.io/david/IndigoUnited/node-detect-readme-badges.svg?style=flat-square',
            service: 'https://david-dm.org/IndigoUnited/node-detect-readme-badges.svg',
            shields: 'https://img.shields.io/david/IndigoUnited/node-detect-readme-badges.svg',
            content: 'https://img.shields.io/david/IndigoUnited/node-detect-readme-badges.json',
        },
        info: {
            service: 'david',
            type: 'dependencies',
            modifiers: { statusType: 'normal' },
        },
    });
    t.same(badges[4], {
{'fraction_non_alphanumeric': 0.17330164388987918, 'fraction_numerical': 0.0019805902158843334, 'mean_word_length': 2.2770927968851393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 26, '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': '206435', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1683, 'n_words': 183}