<commit_before>/**
 * @author <NAME>
 * @copyright 2015 <NAME>
 * @license MIT
 * @module remark:strip-badges:test
 * @fileoverview Test suite for `remark-strip-badges`.
 */

'use strict';

/* eslint-env mocha */

/*
 * Dependencies.
 */

var assert = require('assert');
var remark = require('remark');
var badges = require('./');

/*
 * Fixtures.
 */

var input = [
    '# Hello',
    '',
    'non-badge: ![](http://example.com/fav.ico).',
    '',
    'https: ![build](https://img.shields.io/travis/joyent/node.svg).',
    '',
    'http: ![build](https://img.shields.io/coveralls/jekyll/jekyll.svg).',
    '',
    'reference: ![definition].',
    '',
    'nested: [![definition]](https://npm.im/localeval).',
    '',
    '[definition]: https://img.shields.io/scrutinizer/g/filp/whoops.svg'
].join('\n') + '\n';

var baseline = [
    '# Hello',
    '',
    'non-badge: ![](http://example.com/fav.ico).',
    '',
    'https: .',
    '',
    'http: .',
    '',
    'reference: .',
    '',
    'nested: .',
    '',
    '[definition]: https://img.shields.io/scrutinizer/g/filp/whoops.svg'
].join('\n') + '\n';

/*
 * Tests.
 */

describe('remark-strip-badges', function () {
    it('should work', function (done) {
        remark.use(badges).process(input, function (err, file, doc) {
            done(err);

            assert.equal(doc, baseline);
        });
    });
});<commit_msg>Refactor to replace mocha with tape<commit_after>/**
 * @author <NAME>
 * @copyright 2015 <NAME>
 * @license MIT
 * @module remark:strip-badges:test
 * @fileoverview Test suite for `remark-strip-badges`.
 */

'use strict';

/* eslint-env node */

/*
 * Dependencies.
 */

var test = require('tape');
var remark = require('remark');
var badges = require('./');

/*
 * Tests.
 */

test('remark-strip-badges', function (t) {
    remark.use(badges).process([
        '# Hello',
        '',
        'non-badge: ![](http://example.com/fav.ico).',
        '',
        'https: ![build](https://img.shields.io/travis/joyent/node.svg).',
        '',
        'http: ![build](https://img.shields.io/coveralls/jekyll/jekyll.svg).',
        '',
        'reference: ![definition].',
        '',
        'nested: [![definition]](https://npm.im/localeval).',
        '',
        '[definition]: https://img.shields.io/scrutinizer/g/filp/whoops.svg',
        ''
    ].join('\n'), function (err, file, doc) {
        t.ifErr(err);

        t.equal(doc, [
            '# Hello',
            '',
            'non-badge: ![](http://example.com/fav.ico).',
            '',
            'https&#x3A; .',
            '',
            'http&#x3A; .',
            '',
            'reference: .',
            '',
            'nested: .',
            '',
            '[definition]: https://img.shields.io/scrutinizer/g/filp/whoops.svg',
            ''
        ].join('\n'));

        t.end();
    });
});
{'fraction_non_alphanumeric': 0.23308797756747285, 'fraction_numerical': 0.0035050823694356818, 'mean_word_length': 2.0622317596566524, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 10, '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': '4947564', 'n_tokens_mistral': 1013, 'n_tokens_neox': 1006, 'n_words': 145}