<commit_before>/* eslint-env mocha */

import * as babel from '@babel/core'
import makeVisitor from '../src'
import path from 'path'

require('chai').should()

describe('babel-plugin-istanbul', function () {
  context('Babel plugin config', function () {
    it('should instrument file if shouldSkip returns false', function () {
      var result = babel.transformFileSync('./fixtures/plugin-should-cover.js', {
        plugins: [
          [makeVisitor, {
            include: ['fixtures/plugin-should-cover.js']
          }]
        ]
      })
      result.code.should.match(/statementMap/)
    })

    it('should not instrument file if shouldSkip returns true', function () {
      var result = babel.transformFileSync('./fixtures/plugin-should-not-cover.js', {
        plugins: [
          [makeVisitor, {
            include: ['fixtures/plugin-should-cover.js']
          }]
        ]
      })
      result.code.should.not.match(/statementMap/)
    })

    context('local node_modules', function () {
      it('should instrument file if shouldSkip returns false', function () {
        var result = babel.transformFileSync('./fixtures/node_modules/should-cover.js', {
          plugins: [
            [makeVisitor({ types: babel.types }), {
              excludeNodeModules: false,
              exclude: ['node_modules/**'],
              include: ['fixtures/node_modules/should-cover.js']
            }]
          ]
        })
        result.code.should.match(/statementMap/)
      })

      it('should not instrument file if shouldSkip returns true', function () {
        var result = babel.transformFileSync('./fixtures/node_modules/should-not-cover.js', {
          plugins: [
            [makeVisitor({ types: babel.types }), {
              include: ['fixtures/node_modules/should-not-cover.js']
            }]
          ]
        })
        result.code.should.not.match(/statementMap/)
      })<commit_msg>chore: Fix tests<commit_after>/* eslint-env mocha */

import * as babel from '@babel/core'
import makeVisitor from '../src'
import path from 'path'

require('chai').should()

describe('babel-plugin-istanbul', function () {
  context('Babel plugin config', function () {
    it('should instrument file if shouldSkip returns false', function () {
      var result = babel.transformFileSync('./fixtures/plugin-should-cover.js', {
        plugins: [
          [makeVisitor, {
            include: ['fixtures/plugin-should-cover.js']
          }]
        ]
      })
      result.code.should.match(/statementMap/)
    })

    it('should not instrument file if shouldSkip returns true', function () {
      var result = babel.transformFileSync('./fixtures/plugin-should-not-cover.js', {
        plugins: [
          [makeVisitor, {
            include: ['fixtures/plugin-should-cover.js']
          }]
        ]
      })
      result.code.should.not.match(/statementMap/)
    })

    context('local node_modules', function () {
      it('should instrument file if shouldSkip returns false', function () {
        var result = babel.transformFileSync('./fixtures/node_modules/should-cover.js', {
          plugins: [
            [makeVisitor, {
              excludeNodeModules: false,
              exclude: ['node_modules/**'],
              include: ['fixtures/node_modules/should-cover.js']
            }]
          ]
        })
        result.code.should.match(/statementMap/)
      })

      it('should not instrument file if shouldSkip returns true', function () {
        var result = babel.transformFileSync('./fixtures/node_modules/should-not-cover.js', {
          plugins: [
            [makeVisitor, {
              include: ['fixtures/node_modules/should-not-cover.js']
            }]
          ]
        })
        result.code.should.not.match(/statementMap/)
      })
{'fraction_non_alphanumeric': 0.1393939393939394, 'fraction_numerical': 0.0, 'mean_word_length': 2.139784946236559, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '791805', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1024, 'n_words': 198}