<commit_before>'use strict'

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

test('remark-strip-badges', function(t) {
  t.plan(2)

  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) {
        t.deepEqual(
          [err, String(file)],
          [
            null,
            [
              '# 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')
          ],
          'should work'
        )
      }
    )

  remark()
    .use(badges)
    .process(
      [
        '# remark-strip-badges ' +
          '[![Build Status][build-badge]][build-status] ' +
          '[![Coverage Status][coverage-badge]][coverage-status] ' +
          '[![Chat][chat-badge]][chat]',
        '',
        '[build-badge]: https://img.shields.io/travis/remarkjs/remark-strip-badges.svg',
        '',
        '[build-status]: https://travis-ci.org/remarkjs/remark-strip-badges',
        '',
        '[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-strip-badges.svg',
        '',
        '[coverage-status]: https://codecov.io/github/remarkjs/remark-strip-badges',
        '',
        '[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg',
        '',
        '[chat]: https://gitter.im/remarkjs/Lobby',
        ''
      ].join('\n'),
      function(err, file) {
        t.deepEqual(
          [err, String(file)],
          [
            null,
            [
              '# remark-strip-badges   ',
              '',
              '[build-badge]: https://img.shields.io/travis/remarkjs/remark-strip-badges.svg',
              '',
              '[build-status]: https://travis-ci.org/remarkjs/remark-strip-badges',
              '',
              '[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-strip-badges.svg',
              '',
              '[coverage-status]: https://codecov.io/github/remarkjs/remark-strip-badges',
              '',
              '[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg',
              '',
              '[chat]: https://gitter.im/remarkjs/Lobby',
              ''
            ].join('\n')
          ],
          'should work'<commit_msg>Refactor tests<commit_after>'use strict'

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

test('remark-strip-badges', function(t) {
  t.plan(2)

  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\n'
      ].join('\n\n'),
      function(err, file) {
        t.deepEqual(
          [err, String(file)],
          [
            null,
            [
              '# Hello',
              'non-badge: ![](http://example.com/fav.ico).',
              'https&#x3A; .',
              'http&#x3A; .',
              'reference: .',
              'nested: .',
              '[definition]: https://img.shields.io/scrutinizer/g/filp/whoops.svg\n'
            ].join('\n\n')
          ],
          'should work'
        )
      }
    )

  remark()
    .use(badges)
    .process(
      [
        '# remark-strip-badges [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]',
        '[build-badge]: https://img.shields.io/travis/remarkjs/remark-strip-badges.svg',
        '[build-status]: https://travis-ci.org/remarkjs/remark-strip-badges',
        '[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-strip-badges.svg',
        '[coverage-status]: https://codecov.io/github/remarkjs/remark-strip-badges',
        '[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg',
        '[chat]: https://gitter.im/remarkjs/Lobby\n'
      ].join('\n\n'),
      function(err, file) {
        t.deepEqual(
          [err, String(file)],
          [
            null,
            [
              '# remark-strip-badges   ',
              '[build-badge]: https://img.shields.io/travis/remarkjs/remark-strip-badges.svg',
              '[build-status]: https://travis-ci.org/remarkjs/remark-strip-badges',
              '[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-strip-badges.svg',
              '[coverage-status]: https://codecov.io/github/remarkjs/remark-strip-badges',
              '[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg',
              '[chat]: https://gitter.im/remarkjs/Lobby\n'
            ].join('\n\n')
          ],
          'should work'
{'fraction_non_alphanumeric': 0.1992671436049555, 'fraction_numerical': 0.0010469377072064212, 'mean_word_length': 1.661095636025998, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 34, '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': '5113696', 'n_tokens_mistral': 1894, 'n_tokens_neox': 1929, 'n_words': 187}